1. Go to this page and download the library: Download caydeesoft/permission 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/ */
caydeesoft / permission example snippets
use Caydeesoft\Traits\HasRoles;
class User extends Authenticatable
{
use HasRoles;
use Caydeesoft\Permission\Helpers\Helpers;
class HomeController extends Controller
{
public function index()
{
if(Helpers::can_access({routename e.g 'home.index'}))
{
do something;
}
else
{
do other things;
}
}
}