Metronic : Permission and Role Laravel
how is pattern in an array for permission and role ? it can config in config/menu.php I guess. But I don't know how ?
ps. Sorry My English isn’t that good
Replies (1)
Hi Adobez,
If you are using this plugin as a permission/role module, you can use the "role" or "permission" option in the menu.
https://spatie.be/index.php/docs/laravel-permission/v5/installation-laravel
Example of menu config below.
array(
'title' => 'Troubleshoot',
'path' => 'documentation/getting-started/troubleshoot',
'role' => 'admin',
),
In the menu class, we added condition to check the menu item for current auth user. The menu will be removed if the current has no permission to view it.
app/Core/Adapters/Menu.php
$user->hasAnyRole((array) $value['role'])
Thanks