PHP code example of coucounco / laravel-acl

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

    

coucounco / laravel-acl example snippets


'providers' => [
    // ...
    coucounco\LaravelAcl\ServiceProvider::class,
];

php artisan vendor:publish --provider="coucounco\LaravelAcl\ServiceProvider"

php artisan make:migration create_group_user_table

$user->grantPermissions([
    'page' => ACL_READ,
    'user' => ACL_UPDATE
 ]);
$user->save();

$user->grantPermission('user', ACL_DENY);
$user->save();

$group->grantPermission('user', ACL_READ);
$group->save();

$group->grantPermissions([
    'user' => ACL_READ,
    'page' => ACL_UPDATE,
    'run_page_export' => ACL_ALLOW
]);
$group->save();

$group->revokePermission('user');
$group->save();

$group->revokePermissions(['user', 'run_page_export']);
$group->save();