@extends('layouts.app') @section('title', 'Create Role') @section('content')

Roles

Update role : {{ $role->name }}

@csrf @method('PUT')
{{-- @include('modules.role.bulk_permissions_checkbox', ['modules' => $permissionsByModule]) --}} @php $supersubset = $permissions->pluck('id')->toArray(); $rolePermissionsIds = $role->permissions()->pluck('permission_id')->toArray(); @endphp
@error('permissions') {{ $message }} @enderror
@foreach($permissionsByModule as $module) @php $subset = $module->permissions->pluck('id')->toArray(); $moduleName = strtolower(str_replace(' ', '_', $module->name)); $rolePermissions = $role->permissions()->whereHas('module', function($query) use ($module) { $query->where('name', $module->name); })->get()->pluck('id')->toArray(); @endphp
@foreach($module->permissions as $key => $permission)
permissions()->where('name', $permission->name)->first()) checked @endif @if(!$permission->isActive) disabled @endif>
@endforeach
@endforeach
@endsection @section('page-specific-script') @endsection