i'm overhandle a system using laravel and SmartAdmin UI as the admin panel. i have implemented roles and permission in my system.
if i'm using usual blade like index.blade.php, i can configured the permission using @can, like below
@can('view_document')
//////
@endcan
but since i use admin panel and the menu using config.ui, i don't know how to implementend @can @endcan in my code
<?php
//CONFIGURATION for SmartAdmin UI
//ribbon breadcrumbs config
//array("Display Name" => "URL");
$breadcrumbs = array(
"Home" => APP_URL
);
/*navigation array config
ex:
"dashboard" => array(
"title" => "Display Title",
"url" => "http://yoururl.com",
"url_target" => "_blank",
"icon" => "fa-home",
"label_htm" => "<span>Add your custom label/badge html here</span>",
"sub" => array() //contains array of sub items with the same format as the parent
)
*/
$page_nav = array(
"dashboard" => array(
"title" => "Dashboard",
"url" => "ajax/dashboard.php",
"icon" => "fa-home"
),
);
//configuration variables
$page_title = "";
$page_css = array();
$no_main_header = false; //set true for lock.php and login.php
$page_body_prop = array(); //optional properties for <body>
$page_html_prop = array(); //optional properties for <html>
?>
what i want is, i can use @can @endcan function on the menu, so user can only access the menu based on their role and permission.
i try add @can before "dashboard" => array( but give me an error