@extends('layouts.admin') @section('title', $role->exists ? 'Edit Role' : 'Create Role') @section('content') @php $posted = old('abilities'); $ticked = fn (array $ability) => is_array($posted) ? in_array($ability['key'], $posted, true) : $isTicked($ability); @endphp
@csrf @if ($role->exists) @method('PUT') @endif
{{ $role->exists ? 'Edit role: ' . $role->name : 'Create Role' }}
Back
is_active))>
@if ($members->isNotEmpty())

{{ $members->count() }} user(s) on this role: {{ $members->map(fn ($user) => $user->name)->implode(', ') }}

@endif
What this role can do
View shows the menu in the sidebar and opens the page. Anything left unticked is blocked, even for someone who types the link directly.
@foreach ($sections as $section)
{{ $section['title'] }}
@foreach ($section['rows'] as $row)
{{ $row['title'] }}
@foreach ($row['abilities'] as $ability) @php($id = 'ability-' . md5($ability['key']))
@endforeach
@endforeach
@endforeach
@endsection @push('scripts') @endpush