PHP code example of distilleries / permission-util

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

    

distilleries / permission-util example snippets


    public function hasAccess($key)
    {
        return true;
    }

    protected $routeMiddleware = [
        //...
		'permission' => 'Distilleries\PermissionUtil\Http\Middleware\CheckAccessPermission',
	];

    public function __construct()
    {
        $this->middleware('permission');
    
    }
 php
    'providers' => [
        // ...
       'Distilleries\PermissionUtil\PermissionUtilServiceProvider',
    ]
 php
    'aliases' => [
        // ...
        'PermissionUtil'   => 'Distilleries\PermissionUtil\Facades\PermissionUtil',
    ]
ssh
php artisan vendor:publish --provider="Distilleries\PermissionUtil\PermissionUtilProvider"