PHP code example of sprobe / acl

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

    

sprobe / acl example snippets


php artisan migrate

php artisan acl:make-resource users

$group = Sprobe\Acl\Models\Group::findByName('Administrator');
$group->givePermissionToResource('users', true); // set second param to true if you want to give Write permission, false if read-only

public function __construct()
{
    parent::__construct();

    // enable api middleware
    $this->middleware('acl');
}