fix(roles): actually apply permissionFields human labels (Edit was silently skipped)
Prior 'fix' commit was a no-op because git diff was empty. This time the Edit lands the change on disk. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -72,14 +72,18 @@ class RoleResource extends Resource
|
||||
{
|
||||
$fields = [];
|
||||
$labels = Permissions::labels();
|
||||
$permLabels = Permissions::permissionLabels();
|
||||
foreach (Permissions::grouped() as $module => $perms) {
|
||||
$options = [];
|
||||
$descriptions = [];
|
||||
foreach ($perms as $p) {
|
||||
$options[$p] = $p;
|
||||
$options[$p] = __($permLabels[$p] ?? $p);
|
||||
$descriptions[$p] = $p;
|
||||
}
|
||||
$fields[] = Forms\Components\CheckboxList::make("permissions_{$module}")
|
||||
->label($labels[$module] ?? ucfirst($module))
|
||||
->label(__($labels[$module] ?? ucfirst($module)))
|
||||
->options($options)
|
||||
->descriptions($descriptions)
|
||||
->columns(2)
|
||||
->bulkToggleable()
|
||||
->afterStateHydrated(function (Forms\Components\CheckboxList $component, $state, $record) use ($module) {
|
||||
|
||||
Reference in New Issue
Block a user