PHP code example of luoyt / rbac

1. Go to this page and download the library: Download luoyt/rbac library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luoyt / rbac example snippets

 php
return [
    // RBAC 权限验证
    'user_auth_on'            => true, // 是否开启认证
    'user_auth_type'          => 2, // 默认认证类型 1 - 登录认证 | 2 - 实时认证
    'user_auth_key'           => 'auth_id',    // 用户认证 SESSION 标记
    'admin_auth_key'          => 'administrator',
    'user_auth_model'         => '',    // 默认验证数据表模型
    'user_auth_gateway'       => '/login',    // 默认认证网关
    'not_auth_controller'     => 'Index',        // 默认无需认证控制器,多级控制器使用点语法,严格大小写,多个逗号隔开
    '缀
    'access_table' => 'admin_access', // 权限表名称,不包含表前缀
    'node_table'   => 'admin_node', // 节点表名称,不包含表前缀
];