|
@php $checked = '';
$permission = \App\Permission::where('menu_id',$main_menu->id)->first();
if (isset($role)) {
if (in_array($permission->id, $rolePermissions)) {
$checked = 'checked';
} else {
$checked = '';
}
}
@endphp
@isset($main_menu->submenus)
@if(count($main_menu->submenus))
@foreach ($main_menu->submenus as $submenu)
|
@php $checked = '';
$access = 'access_'.$submenu->slug;
$where = [] ;
$where[] = ['menu_id','=',$submenu->id];
$where[] = ['title','=',$access];
$access_permission = \App\Permission::where($where)->first();
if (isset($role)) {
if (in_array($access_permission->id, $rolePermissions)) {
$checked = 'checked';
} else {
$checked = '';
}
}
@endphp
@php
$subpermissions = \App\Permission::where('menu_id',$submenu->id)->get();
@endphp
|
@isset($subpermissions)
@if(count($subpermissions) > 1)
@foreach ($subpermissions as $subpermission)
@php $checked = '';
if (isset($role)) {
if (in_array($subpermission->id, $rolePermissions)) {
$checked = 'checked';
} else {
$checked = '';
}
}
@endphp
|
@endforeach
@endif
@endisset
@isset($submenu->subsubmenus)
@if(count($submenu->subsubmenus))
@foreach ($submenu->subsubmenus as $subsubmenu)
|
@php $checked = '';
$access = 'access_'.$subsubmenu->slug;
$where = [] ;
$where[] = ['menu_id','=',$subsubmenu->id];
$where[] = ['title','=',$access];
$access_permission = \App\Permission::where($where)->first();
if (isset($role)) {
if (in_array($access_permission->id, $rolePermissions)) {
$checked = 'checked';
} else {
$checked = '';
}
}
@endphp
@php
$subsubpermissions =
\App\Permission::where('menu_id',$subsubmenu->id)->get();
@endphp
|
@isset($subsubpermissions)
@if(count($subsubpermissions) > 1)
@foreach ($subsubpermissions as $subsubpermission)
@php $checked = '';
if (isset($role)) {
if (in_array($subsubpermission->id, $rolePermissions)) {
$checked = 'checked';
} else {
$checked = '';
}
}
@endphp
|
@endforeach
@endif
@endisset
@endforeach
|
@endif
@endisset
@endforeach
@endif
@endisset
|
@endforeach