app/Api/V1/Controllers/PermissionController.php
/**
    * protected function to generate permissions based on name. eg user generates view_users, add_users etc
    *
    * @param string $permission_name
    *
    * @return array
     */
protected function to generate permissions based on name.

@return array
protected function to generate permissions based on name . @return array
protected function generatePermissions(string $permission_name)
    {
        $abilities = ['view', 'add', 'edit', 'delete'];
        $name = $this->getNameArgument($permission_name);
        return array_map(function ($val) use ($name) {
            return $val . '_'. $name;
        }, $abilities);
    }
protected function generatePermissions ( string $ permission_name ) { $ abilities = [ 'view' , 'add' , 'edit' , 'delete' ] ; $ name = $ this -> getNameArgument ( $ permission_name ) ; return array_map ( function ( $ val ) use ( $ name ) { return $ val . '_' . $ name ; } , $ abilities ) ; }
protected function to generate permissions based on name.
protected function to generate permissions based on name .