Reputation: 48
Is there any way to set custom folder controllers prefix like routes in laravel 5.6?
Route::get("/", "Foo/Controller@method");
Route::post("/", "Foo/Bar/Controller@method");
Route::get("/index", "Foo/Bar/Controller/Controller@method");
I want this
Route::get("/", "Foo::Controller@method");
Route::post("/", "Foo::Bar.Controller@method");
Route::get("/index", "Foo::Bar.Controller.Controller@method");
Upvotes: 1
Views: 181
Reputation: 35347
No, but you can group your routes and set a starting namespace for the entire group:
Route::group([
'namespace' => 'Foo'
], function () {
Route::get("/", "Controller@method");
Route::post("/", "Bar\\Controller@method");
});
Upvotes: 1