@extends('layouts.app') @php $editing = $role->exists; $action = $editing ? route('admin.roles.update', $role) : route('admin.roles.store'); $granted = old('permissions', $granted); $isSuperAdmin = $role->slug === \App\Models\Role::SUPER_ADMIN; @endphp @section('title', $editing ? 'Edit role' : 'Add role') @section('heading', $editing ? 'Access rights — '.$role->name : 'Add a role') @section('actions') Cancel @endsection @section('content') @if ($isSuperAdmin)
The super administrator role always holds every right, including any added in future, so its ticks cannot be changed. Only the label and description are editable.
@endif
@csrf @if ($editing) @method('PUT') @endif
@error('name')
{{ $message }}
@enderror
Lower sorts first.
@foreach ($catalogue as $group => $permissions)
{{ $group }}
@foreach ($permissions as $slug => $description)
@endforeach
@endforeach
Cancel
@endsection