PHP code example of ttlphp / laravel-crbac

1. Go to this page and download the library: Download ttlphp/laravel-crbac 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/ */

    

ttlphp / laravel-crbac example snippets


'Laravel\\Crbac\\' => array($vendorDir . '/laravel-crbac/src'),

$vendorDir . '/laravel-crbac/src/helpers.php',

Laravel\Crbac\ServiceProvider::class,

'model' => Laravel\Crbac\Models\Power\Admin::class,

'locale' => 'cn',

// 必需要有登录数据,否则永远返回false
// 此函数是所有权限验证通用函数
isPower($code, $default = false):bool
shell
php artisan crbac:table
shell
php artisan crbac:lang