1. Go to this page and download the library: Download weirdo/dynamic-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/ */
$user->hasPermission('admin.articles.update', $article);
// Or with a custom relation_key (default is 'user_id')
$user->hasPermission('admin.articles.update', $article, 'owner_id');
$user->isOwner($article);
// Or with a custom relation_key
$user->isOwner($article, 'owner_id');
// Or pass it as ['model' => id]
$user->isOwner(['article' => $article->id]);
// Or with a custom model path
$user->isOwner(['App\\Article' => $article->id]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.