PHP code example of nelisys / rbac

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

    

nelisys / rbac example snippets


// config/auth.php
    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => Nelisys\Rbac\Models\User::class,
        ],

// app/Http/Kernel.php
    protected $middlewareGroups = [
        'api' => [
            \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,

php artisan vendor:publish --provider="Nelisys\Rbac\RbacServiceProvider"

php artisan migrate