PHP code example of oldfurybird / rabc

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

    

oldfurybird / rabc example snippets

        
      'providers'=>[
          ...
        /*
         * Package Service Providers...
         */
         Rabc\RabcServiceProvider::class,
        ...
      ],

 $role = Role::create(['name'=>'test','display_name'=>'测试','description'=>'能否通过?']);
 $user->attachRole($role);
 $user->hasRole('test');//true;
 $user->can('test_perm');//false;

 $permission = Permission::create(['name'=>'test_perm','display_name'=>'测试权限','description'=>'能否通过?']);
 $role->attachPermission($permission);
 $user->can('test_perm');//true;