1. Go to this page and download the library: Download vinlon/laravel-lay-admin 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/ */
vinlon / laravel-lay-admin example snippets
class AdminRoleExtend extends AdminRole
{
const TEST = '新角色测试';
/**
* @return string[]
*/
public function getMenuIds()
{
$roleMenus = [
self::TEST => ['_my.profile', 'ops.setting', '_user'],
];
return Arr::get($roleMenus, $this->value, []);
}
/**
* @return string[]
*/
public function getPrivileges()
{
$rolePrivileges = [
self::TEST => [1, 2, 3],
];
return Arr::get($rolePrivileges, $this->value, []);
}
}