Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$routes->group('user', [
'filter' => 'permission:manage-user',
'namespace' => 'agungsugiarto\boilerplate\Controllers\Users',
],
function($routes)
{
$routes->get('show', 'UserController::show', ['as' => 'user-show']);
},
function ($routes)
{
$routes->get('/', 'UserController::index');
$routes->post('create', 'UserController::create');
$routes->get('edit/(:num)', 'UserController::edit/$1');
$routes->put('update/(:num)', 'UserController::update/$1');
$routes->delete('delete/(:num)', 'UserController::delete/$1');
}
);
@agungsugiarto
Copy link

agungsugiarto commented Mar 12, 2020

/**
 * User routes.
 **/
$routes->group('user', [
    'filter' => 'permission:back-office',
    'namespace' => 'agungsugiarto\boilerplate\Controllers\Users'
], function ($routes) {
    $routes->get('show', 'UserController::show', ['as' => 'user-show']);
    $routes->group('', [
        'filter' => 'permission:role-permission',
        'namespace' => 'agungsugiarto\boilerplate\Controllers\Users'
    ], function($routes) {
        $routes->get('/', 'UserController::index');
        $routes->post('create', 'UserController::create');
        $routes->get('edit/(:num)', 'UserController::edit/$1');
        $routes->put('update/(:num)', 'UserController::update/$1');
        $routes->delete('delete/(:num)', 'UserController::delete/$1');
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment