Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 1 year ago.
0

I don't think the Route::controller works with Lumen.

You could just make the rest routes yourself,

In you routes.php file

 $app->get('foo', 'fooController@index');
 $app->get('foo/{id}', 'fooController@show');
 $app->post('foo', 'fooController@store');
 $app->put('foo/{id}', 'fooController@update');
 $app->delete('foo/{id}', 'fooController@destroy');

// the controllers will need a full class path

It wouldn't take much to make this a small function if you have multiple routes. The you could do something like,

makeControllerRoute('/foo', 'App\Http\Controllers\fooController');

And since you say works "out of the box".. I'm going to add in a reminder about if you want to use the facades you will need to enable them in the app.php file along with the .env load config support.

Dotenv::load(__DIR__.'/../');

$app->withFacades();
 
$app->withEloquent();

Hope that helps.

Last updated 9 years ago.
0

http://lumen.laravel.com/docs/controllers, has examples, it is a little different.
$app->get('user/{id}', 'App\Http\Controllers\UserController@showProfile');

Last updated 9 years ago.
0

I've come to terms that it does not work like in Laravel, so I specified all my routes like you said.

Thanks for you help

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ByroRedux byroredux Joined 25 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.