public function mapWebRoutes(Router $router)
    {
        $permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug(
            $this->getModelSlug()
        );

        $router->group(
            [
                'prefix'    => $this->getRoutePrefix(),
                'as'        => $this->getRouteNamePrefix(),
                'middleware' => [ cms_mw_permission("{$permissionPrefix}*") ],
            ],
            function (Router $router) use ($permissionPrefix) {

                $controller = $this->getModelWebController();

                $router->get('/', [
                    'as'   => 'index',
                    'uses' => $controller . '@index',
                ]);

                $router->get('create', [
                    'as'         => 'create',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}create")],
                    'uses'       => $controller . '@create',
                ]);

                $router->post('/', [
                    'as'         => 'store',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}create"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@store',
                ]);

                $router->post('filter', [
                    'as'   => 'filter',
                    'uses' => $controller . '@filter',
                ]);

                $router->get('export/{strategy}', [
                    'as'         => 'export',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}export")],
                    'uses'       => $controller . '@export',
                ]);

                $router->get('{key}', [
                    'as'   => 'show',
                    'uses' => $controller . '@show',
                ]);

                $router->get('{key}/edit', [
                    'as'         => 'edit',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@edit',
                ]);

                $router->put('{key}/activate', [
                    'as'         => 'activate',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@activate',
                ]);

                $router->put('{key}/position', [
                    'as'         => 'position',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@position',
                ]);

                $router->get('{key}/deletable', [
                    'as'         => 'deletable',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@deletable',
                ]);

                $router->put('{key}', [
                    'as'         => 'update',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}edit"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@update',
                ]);

                $router->delete('{key}', [
                    'as'         => 'destroy',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@destroy',
                ]);
            }
        );
    }
public function mapWebRoutes(Router $router)
    {
        $permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug(
            $this->getModelSlug()
        );

        $router->group(
            [
                'prefix'    => $this->getRoutePrefix(),
                'as'        => $this->getRouteNamePrefix(),
                'middleware' => [ cms_mw_permission("{$permissionPrefix}*") ],
            ],
            function (Router $router) use ($permissionPrefix) {

                $controller = $this->getModelWebController();

                $router->get('/', [
                    'as'   => 'index',
                    'uses' => $controller . '@index',
                ]);

                $router->get('create', [
                    'as'         => 'create',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}create")],
                    'uses'       => $controller . '@create',
                ]);

                $router->post('/', [
                    'as'         => 'store',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}create"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@store',
                ]);

                $router->post('filter', [
                    'as'   => 'filter',
                    'uses' => $controller . '@filter',
                ]);

                $router->get('export/{strategy}', [
                    'as'         => 'export',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}export")],
                    'uses'       => $controller . '@export',
                ]);

                $router->get('{key}', [
                    'as'   => 'show',
                    'uses' => $controller . '@show',
                ]);

                $router->get('{key}/edit', [
                    'as'         => 'edit',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@edit',
                ]);

                $router->put('{key}/activate', [
                    'as'         => 'activate',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@activate',
                ]);

                $router->put('{key}/position', [
                    'as'         => 'position',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}edit")],
                    'uses'       => $controller . '@position',
                ]);

                $router->get('{key}/deletable', [
                    'as'         => 'deletable',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@deletable',
                ]);

                $router->put('{key}', [
                    'as'         => 'update',
                    'middleware' => [
                        cms_mw_permission("{$permissionPrefix}edit"),
                        StoreActiveFormContext::class,
                    ],
                    'uses'       => $controller . '@update',
                ]);

                $router->delete('{key}', [
                    'as'         => 'destroy',
                    'middleware' => [cms_mw_permission("{$permissionPrefix}delete")],
                    'uses'       => $controller . '@destroy',
                ]);
            }
        );
    }
public function mapWebRoutes ( Router $ router ) { $ permissionPrefix = $ this -> routeHelper -> getPermissionPrefixForModelSlug ( $ this -> getModelSlug ( ) ) ; $ router -> group ( [ 'prefix' => $ this -> getRoutePrefix ( ) , 'as' => $ this -> getRouteNamePrefix ( ) , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}*" ) ] , ] , function ( Router $ router ) use ( $ permissionPrefix ) { $ controller = $ this -> getModelWebController ( ) ; $ router -> get ( '/' , [ 'as' => 'index' , 'uses' => $ controller . '@index' , ] ) ; $ router -> get ( 'create' , [ 'as' => 'create' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}create" ) ] , 'uses' => $ controller . '@create' , ] ) ; $ router -> post ( '/' , [ 'as' => 'store' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}create" ) , StoreActiveFormContext :: class , ] , 'uses' => $ controller . '@store' , ] ) ; $ router -> post ( 'filter' , [ 'as' => 'filter' , 'uses' => $ controller . '@filter' , ] ) ; $ router -> get ( 'export/{strategy}' , [ 'as' => 'export' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}export" ) ] , 'uses' => $ controller . '@export' , ] ) ; $ router -> get ( '{key}' , [ 'as' => 'show' , 'uses' => $ controller . '@show' , ] ) ; $ router -> get ( '{key}/edit' , [ 'as' => 'edit' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}edit" ) ] , 'uses' => $ controller . '@edit' , ] ) ; $ router -> put ( '{key}/activate' , [ 'as' => 'activate' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}edit" ) ] , 'uses' => $ controller . '@activate' , ] ) ; $ router -> put ( '{key}/position' , [ 'as' => 'position' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}edit" ) ] , 'uses' => $ controller . '@position' , ] ) ; $ router -> get ( '{key}/deletable' , [ 'as' => 'deletable' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}delete" ) ] , 'uses' => $ controller . '@deletable' , ] ) ; $ router -> put ( '{key}' , [ 'as' => 'update' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}edit" ) , StoreActiveFormContext :: class , ] , 'uses' => $ controller . '@update' , ] ) ; $ router -> delete ( '{key}' , [ 'as' => 'destroy' , 'middleware' => [ cms_mw_permission ( "{$permissionPrefix}delete" ) ] , 'uses' => $ controller . '@destroy' , ] ) ; } ) ; }
Generates web routes for the module given a contextual router instance.
Note that the module is responsible for ACL-checks, including route-based.

@param Router $router
Generates web routes for the module given a contextual router instance . Note that the module is responsible for ACL - checks including route - based .