Skip to content

Commit

Permalink
Use manual route definition over the route resource shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Jul 7, 2015
1 parent beea0ed commit 81ae31a
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions Http/backendRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,18 @@
$router->model('menus', 'Modules\Menu\Entities\Menu');
$router->model('menuitem', 'Modules\Menu\Entities\Menuitem');

$router->group(['prefix' => '/menu'], function (Router $router) {
$router->resource('menus', 'MenuController', [
'except' => ['show'],
'names' => [
'index' => 'admin.menu.menu.index',
'create' => 'admin.menu.menu.create',
'store' => 'admin.menu.menu.store',
'edit' => 'admin.menu.menu.edit',
'update' => 'admin.menu.menu.update',
'destroy' => 'admin.menu.menu.destroy',
],
]);
$router->group(['prefix' => '/menu'], function () {
get('menus', ['as' => 'admin.menu.menu.index', 'uses' => 'MenuController@index']);
get('menus/create', ['as' => 'admin.menu.menu.create', 'uses' => 'MenuController@create']);
post('menus', ['as' => 'admin.menu.menu.store', 'uses' => 'MenuController@store']);
get('menus/{menus}/edit', ['as' => 'admin.menu.menu.edit', 'uses' => 'MenuController@edit']);
put('menus/{menus}', ['as' => 'admin.menu.menu.update', 'uses' => 'MenuController@update']);
delete('menus/{menus}', ['as' => 'admin.menu.menu.destroy', 'uses' => 'MenuController@destroy']);

$router->resource('menus.menuitem', 'MenuItemController', [
'except' => ['show'],
'names' => [
'index' => 'dashboard.menuitem.index',
'create' => 'dashboard.menuitem.create',
'store' => 'dashboard.menuitem.store',
'edit' => 'dashboard.menuitem.edit',
'update' => 'dashboard.menuitem.update',
'destroy' => 'dashboard.menuitem.destroy',
],
]);
get('menus/{menus}/menuitem', ['as' => 'dashboard.menuitem.index', 'uses' => 'MenuItemController@index']);
get('menus/{menus}/menuitem/create', ['as' => 'dashboard.menuitem.create', 'uses' => 'MenuItemController@create']);
post('menus/{menus}/menuitem', ['as' => 'dashboard.menuitem.store', 'uses' => 'MenuItemController@store']);
get('menus/{menus}/menuitem/{menuitem}/edit', ['as' => 'dashboard.menuitem.edit', 'uses' => 'MenuItemController@edit']);
put('menus/{menus}/menuitem/{menuitem}', ['as' => 'dashboard.menuitem.update', 'uses' => 'MenuItemController@update']);
delete('menus/{menus}/menuitem/{menuitem}', ['as' => 'dashboard.menuitem.destroy', 'uses' => 'MenuItemController@destroy']);
});

0 comments on commit 81ae31a

Please sign in to comment.