{{-- Variables: $permissionsByPage — Collection grouped by page key $modulePages — ['page_key' => 'Display Label'] $rolePermIds — array of permission IDs already assigned ([] for create) $readonly — bool: true = show checkmarks only, false = show checkboxes --}} @php $childPages = ['manage_inventory', 'manage_orders', 'delivery_team']; $actions = ['Create', 'Read', 'Update', 'Delete']; @endphp
| Module | Permissions | ||||
|---|---|---|---|---|---|
| {{ $modulePages[$page] }} |
@foreach($actions as $action)
@php $perm = $perms->firstWhere('name', $action); @endphp
@if($perm)
@if($readonly)
{{ $action }}
@else
id, $rolePermIds) ? 'checked' : '' }}>
@endif
@endif
@endforeach
|
||||
|
|
Product Management | ||||
| {{ $modulePages[$page] }} |
@foreach($actions as $action)
@php $perm = $perms->firstWhere('name', $action); @endphp
@if($perm)
@if($readonly)
{{ $action }}
@else
id, $rolePermIds) ? 'checked' : '' }}>
@endif
@endif
@endforeach
|
||||
| {{ $modulePages[$page] }} |
@foreach($actions as $action)
@php $perm = $perms->firstWhere('name', $action); @endphp
@if($perm)
@if($readonly)
{{ $action }}
@else
id, $rolePermIds) ? 'checked' : '' }}>
@endif
@endif
@endforeach
|
||||