@foreach($permissionGroupTypeList as $key => $permissionGroupType)
{{$permissionGroupType->name}} Permissions
@foreach($permissionGroupType->permissionGroups as $key=>$value) @php $collectionArray = $value->getPermission->pluck('id')->toArray(); $checkAll = ''; if(count($role_permission) > 0){ $diff = array_diff($collectionArray, $role_permission); if (empty($diff)) { $checkAll = 'checked'; } } @endphp
{{$value->name}} Module:
    @foreach($value->getPermission as $keys => $permission) @php $checked=''; if(count($role_permission) > 0){ if(in_array($permission->id,$role_permission)){ $checked = "checked = 'checked'"; } } @endphp
  • @endforeach
@endforeach
@endforeach