1. Go to this page and download the library: Download silvanite/brandenburg 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/ */
// Grant access
$editor->grant('create-articles');
// Revoke access
$editor->revoke('create-articles');
// Grant access to a set of permissions and remove all other permissions
$editor->setPermissions([
'create-articles',
'read-articles',
'update-articles',
'delete-articles',
]);
// Revoke all permissions
$editor->revokeAll();
// Using slug
$user->assignRole('editor');
$user->removeRole('editor');
// Using model
use Silvanite\Brandenburg\Role;
$user->assignRole(Role::first());
$user->removeRole(Role::first());
$user->setRolesById([1, 3, 4]);
// Same as
$user->roles()->sync([1, 3, 4]);