PHP code example of echods / roles

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

    

echods / roles example snippets


$ php artisan vendor:publish --tag=roles

$ php artisan vendor:publish --tag=roles-config
$ php artisan vendor:publish --tag=roles-migrations
$ php artisan vendor:publish --tag=roles-seeders
$ php artisan vendor:publish --tag=roles-models
$ php artisan vendor:publish --tag=roles-traits



return [

    /*
    |--------------------------------------------------------------------------
    | Default Roles
    |--------------------------------------------------------------------------
    |
    | Here you can setup your default roles to seed your database
    |
    */
    'all' => [
        [
            'handle' => 'admin',
            'description' => 'Administrator role with full access'
        ],
        [
            'handle' => 'editor',
            'description' => 'Editor role with content management access'
        ],
        [
            'handle' => 'user',
            'description' => 'Basic user role with limited access'
        ],
    ],
    ...

$ php artisan migrate

$ php artisan db:seed --class=RolesSeeder

$ php artisan db:seed --class="EchoDS\\\\Roles\\\\Database\\\\Seeders\\\\RolesSeeder"