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.
http://lumen.laravel.com/docs/controllers, has examples, it is a little different.
$app->get('user/{id}', 'App\Http\Controllers\UserController@showProfile');
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community