PHP code example of zakariajawas / permissions-generator

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

    

zakariajawas / permissions-generator example snippets


php artisan permissions:generate

composer 

php artisan vendor:publish --provider="ZakariaJawas\PermissionsGenerator\GeneratePermissionsProvider"

'permissions' => ['list', 'create', 'edit', 'delete']

'permissions' => ['access', 'list', 'create', 'update', 'delete']

'exclude' => [
App\Models\Session::class, //no permissions generated for Session model
],

'staticPermissions' => ['export pdf', 'access dashboard']

'prefix' => 'can',