@extends ('admin.layouts.default') @section ('main')

@php echo (isset($role)) ? __('labels.role.edit_role') : __('labels.role.create_role'); @endphp

@include('admin.partials.x-toolbar') @php $action = (isset($role)) ? route('admin.users.roles.update', $query) : route('admin.users.roles.store', $query) @endphp
@csrf @if (isset($role)) @method('put') @endif @foreach ($fields as $field) @php $value = (isset($role)) ? old($field->name, $field->value) : old($field->name); @endphp
@endforeach

{{ __('labels.title.permissions') }}

@foreach ($board as $section => $checkboxes)
{{ $section }}
@foreach ($checkboxes as $key => $checkbox) @if (is_array(old('permissions')) && in_array($checkbox->value, old('permissions'))) @php $checkbox->checked = true; @endphp @elseif (is_array(old('permissions')) && !in_array($checkbox->value, old('permissions'))) @php $checkbox->checked = false; @endphp @endif @endforeach
@endforeach @if (isset($role)) @endif @if (!isset($role)) @endif @if (isset($role))
@method('delete') @csrf
@endif @endsection @push ('style') @endpush @push ('scripts') @endpush