Open wgh000 opened 5 years ago
Groups has prefix and Individual routes has names. I dont think that group should have a name.
Yes, groups have prefix
(URL prefix), but as per documentation (https://laravel.com/docs/master/routing#route-group-name-prefixes) there is also name prefix
: the fact that prefix is called name
and it differs from the internal code, is not a great help.
I think the naming should be unified.
Route Name Prefixes
Route::name('admin.')->group(function () {
Route::get('users', function () {
// Route assigned name "admin.users"...
})->name('users');
});
In this example, route can be called using route('admin.users')
but doesn't mean that will correspond to a /admin/users
URI
I agree with OP. The naming can be improved.
Documentation suggest to use function
name()
in order to prefix routes names:But, writing a custom entry in RouteServiceProvider.php requires to use the
as
parameter and that's not so clear.What I propose is a quick fix in order to start uniforming variables names.
Please check changes proposed: https://github.com/wgh000/framework/commit/a1c4bedc91e97a9ea631af179e9318686899f303