PHP code example of holoultek / laravel-capabilities
1. Go to this page and download the library: Download holoultek/laravel-capabilities 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/ */
$auth->capabilityAttach('Capability Name');
$auth->capabilityDetach('Capability Name');
// or in short
$auth->ca('Capability Name');
$auth->cd('Capability Name');
$auth->roleAttach('Role Name');
$auth->roleDetach('Role Name');
// or in short
$auth->ra('Role Name');
$auth->rd('Role Name');
$auth->hasCapability('Capability Name');
$auth->hasRole('Role Name');
// or in short
$auth->hc('Capability Name');
$auth->hr('Role Name');