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 = [];
|
$fields = [];
|
||||||
$labels = Permissions::labels();
|
$labels = Permissions::labels();
|
||||||
|
$permLabels = Permissions::permissionLabels();
|
||||||
foreach (Permissions::grouped() as $module => $perms) {
|
foreach (Permissions::grouped() as $module => $perms) {
|
||||||
$options = [];
|
$options = [];
|
||||||
|
$descriptions = [];
|
||||||
foreach ($perms as $p) {
|
foreach ($perms as $p) {
|
||||||
$options[$p] = $p;
|
$options[$p] = __($permLabels[$p] ?? $p);
|
||||||
|
$descriptions[$p] = $p;
|
||||||
}
|
}
|
||||||
$fields[] = Forms\Components\CheckboxList::make("permissions_{$module}")
|
$fields[] = Forms\Components\CheckboxList::make("permissions_{$module}")
|
||||||
->label($labels[$module] ?? ucfirst($module))
|
->label(__($labels[$module] ?? ucfirst($module)))
|
||||||
->options($options)
|
->options($options)
|
||||||
|
->descriptions($descriptions)
|
||||||
->columns(2)
|
->columns(2)
|
||||||
->bulkToggleable()
|
->bulkToggleable()
|
||||||
->afterStateHydrated(function (Forms\Components\CheckboxList $component, $state, $record) use ($module) {
|
->afterStateHydrated(function (Forms\Components\CheckboxList $component, $state, $record) use ($module) {
|
||||||
|
|||||||
Reference in New Issue
Block a user