See this example:
Route::group(array('prefix' => 'admin'), function()
{
//this resolves to admin/departments
Route::resource('departments', 'DepartmentsAdminController');
//this resolves to admin/users
Route::resource('users', 'UsersAdminController');
//this resolves to admin/companies
Route::resource('companies', 'CompaniesAdminController');
Route::resource('projects', 'ProjectsAdminController');
Route::resource('jobs', 'JobsAdminController');
Route::resource('milestones', 'MilestonesAdminController');
Route::resource('hours', 'HoursAdminController');
Route::resource('notes', 'NotesAdminController');
Route::resource('briefs', 'BriefsAdminController');
Route::resource('brief_items', 'BriefItemsAdminController');
});
Laravel changes route names based on the prefix in this case the prefix is admin
so all route names now prefixed with admin see:
admin.users.create
admin.users.edit
But what if i want to change the prefix to something else I will have to change the route names in my entire application.
What i want is to keep route name as is
users.create
users.edit
and change the prefix without changing the route name.
Is there a way to keep the route names in resource controllers static and change the prefix anytime i want ?