Hi there.
I just started to use Lumen and wondering if there is a better way to fix this:
as we know in bootstrap/app.php the routes.php file is included in the following way:
$app->group(['namespace' => 'App\Http\Controllers'], function ($app) {
require __DIR__.'/../app/Http/routes.php';
});
So everything works good if I define simple routes in routes.php:
$app->get('/public/airports', 'AirportsController@index');
But if I define another group with prefixes in routes.php, I cannot use namespace-less controller names and have to use full notation :
$app->group(['prefix' => 'public'], function ($app) {
$app->get('/test', 'App\Http\Controllers\AirportsController@index');
});
or adding namespace parameter :
$app->group(['prefix' => 'public', 'namespace' => 'App\Http\Controllers'], function ($app) {
$app->get('/test', 'AirportsController@index');
});
is there a way to avoid that?