private function getPermissionData($route)
    {
        $description = '';
        $chunks = explode('\\', $route['controller']);
        $module = strtolower(end($chunks));
        $module = str_replace('controller', '', $module);

        $messages = [
            'index'   => 'List all :modules',
            'create'  => 'Create :modules',
            'show'    => 'Preview :module',
            'edit'    => 'Update :modules',
            'destroy' => 'Delete :modules'
        ];
        $pattern = [
            '#:module#',
            '#:modules#'
        ];
        $replacement = [
            $module,
            str_plural($module)
        ];

        if (array_key_exists($route['action'], $messages)) {
            $description = preg_replace($pattern, $replacement, $messages[$route['action']]);
        }

        return [
            'resource'    => $route['resource'],
            'controller'  => $route['controller'],
            'method'      => $route['action'],
            'description' => $description,
        ];
    }
private function getPermissionData($route)
    {
        $description = '';
        $chunks = explode('\\', $route['controller']);
        $module = strtolower(end($chunks));
        $module = str_replace('controller', '', $module);

        $messages = [
            'index'   => 'List all :modules',
            'create'  => 'Create :modules',
            'show'    => 'Preview :module',
            'edit'    => 'Update :modules',
            'destroy' => 'Delete :modules'
        ];
        $pattern = [
            '#:module#',
            '#:modules#'
        ];
        $replacement = [
            $module,
            str_plural($module)
        ];

        if (array_key_exists($route['action'], $messages)) {
            $description = preg_replace($pattern, $replacement, $messages[$route['action']]);
        }

        return [
            'resource'    => $route['resource'],
            'controller'  => $route['controller'],
            'method'      => $route['action'],
            'description' => $description,
        ];
    }
private function getPermissionData ( $ route ) { $ description = '' ; $ chunks = explode ( '\\' , $ route [ 'controller' ] ) ; $ module = strtolower ( end ( $ chunks ) ) ; $ module = str_replace ( 'controller' , '' , $ module ) ; $ messages = [ 'index' => 'List all :modules' , 'create' => 'Create :modules' , 'show' => 'Preview :module' , 'edit' => 'Update :modules' , 'destroy' => 'Delete :modules' ] ; $ pattern = [ '#:module#' , '#:modules#' ] ; $ replacement = [ $ module , str_plural ( $ module ) ] ; if ( array_key_exists ( $ route [ 'action' ] , $ messages ) ) { $ description = preg_replace ( $ pattern , $ replacement , $ messages [ $ route [ 'action' ] ] ) ; } return [ 'resource' => $ route [ 'resource' ] , 'controller' => $ route [ 'controller' ] , 'method' => $ route [ 'action' ] , 'description' => $ description , ] ; }
Setup permission data

@param $route

@return array
Setup permission data