is there any chance to reduce the routes.php
i have for one Model methods for day, week, month and year operations. Here is the routes only for weekly operations, but i have the same for the other periods. Is there any chance to reduce them ?
Route::get('capacity/{capacity}/createweekly', [
'as' => 'admin.capacity.createweekly', 'uses' => 'CapacityController@createweekly'
]);
Route::put('capacity/{capacity}/storeweekly', [
'as' => 'admin.capacity.storeweekly', 'uses' => 'CapacityController@storeweekly'
]);
Route::get('capacity/{period}/activateweekly', [
'as' => 'admin.capacity.activateweekly', 'uses' => 'CapacityController@activateweekly'
]);
Route::get('capacity/{period}/deactivateweekly', [
'as' => 'admin.capacity.deactivateweekly', 'uses' => 'CapacityController@deactivateweekly'
]);
Route::get('capacity/{period}/deleteweekly', [
'as' => 'admin.capacity.deleteweekly', 'uses' => 'CapacityController@deleteweekly'
]);
Route::get('capacity/{period}/editweekly', [
'as' => 'admin.capacity.editweekly', 'uses' => 'CapacityController@editweekly'
]);
Route::post('capacity/{period}/updateweekly', [
'as' => 'admin.capacity.updateweekly', 'uses' => 'CapacityController@updateweekly'
]);
You can try to group them:
Route::group(['as' => 'admin.capacity.', 'prefix' => 'capacity'], function () {
Route::get('{capacity}/createweekly', [
'as' => 'createweekly', 'uses' => 'CapacityController@createweekly'
]);
Route::put('{capacity}/storeweekly', [
'as' => 'storeweekly', 'uses' => 'CapacityController@storeweekly'
]);
Route::get('{period}/activateweekly', [
'as' => 'activateweekly', 'uses' => 'CapacityController@activateweekly'
]);
Route::get('{period}/deactivateweekly', [
'as' => 'deactivateweekly', 'uses' => 'CapacityController@deactivateweekly'
]);
Route::get('{period}/deleteweekly', [
'as' => 'deleteweekly', 'uses' => 'CapacityController@deleteweekly'
]);
Route::get('{period}/editweekly', [
'as' => 'editweekly', 'uses' => 'CapacityController@editweekly'
]);
Route::post('{period}/updateweekly', [
'as' => 'updateweekly', 'uses' => 'CapacityController@updateweekly'
]);
});