@section('title', 'Permission') @extends('admin.layouts.app') @push('style') @endpush @section('content')
arrow_back
@csrf @php $permissions = $sub_admin->getPermissions($sub_admin->id); @endphp
@foreach ($menus as $menu)

{{str_replace("List"," ", $menu->manager_name)}}

@if (!empty($menu->routes)) @php $checked = ''; if( isset($permissions[$menu->id]) && ($permissions[$menu->id] == $menu->routes) ){ $checked = 'checked="checked"'; } @endphp
@endif @foreach ($menu->getChildMenus($menu->id) as $key => $value) @php $checked = ''; if (isset($permissions[$value->id]) && ($permissions[$value->id] == $value->routes)) { $checked = 'checked="checked"'; } @endphp
@if ($value->getChildMenus($value->id)->count() > 0)
@foreach ($value->getChildMenus($value->id) as $subKey => $subValue) @php $subChecked = ''; if (isset($permissions[$subValue->id]) && ($permissions[$subValue->id] == $subValue->routes)) { $subChecked = 'checked="checked"'; } @endphp
@endforeach
@endif @endforeach
@endforeach
@endsection @push('script') @endpush