Skip to content

Commit 96c2761

Browse files
authored
Fix permission:show uuid error #2581 (#2582)
Use `getKeyName()` instead of `'id'` Fixes #2581
1 parent 2c5369e commit 96c2761

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Commands/Show.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function handle()
4040
->when($teamsEnabled, fn ($q) => $q->orderBy($team_key))
4141
->orderBy('name')->get()->mapWithKeys(fn ($role) => [
4242
$role->name.'_'.($teamsEnabled ? ($role->$team_key ?: '') : '') => [
43-
'permissions' => $role->permissions->pluck('id'),
43+
'permissions' => $role->permissions->pluck($permissionClass->getKeyName()),
4444
$team_key => $teamsEnabled ? $role->$team_key : null,
4545
],
4646
]);
4747

48-
$permissions = $permissionClass::whereGuardName($guard)->orderBy('name')->pluck('name', 'id');
48+
$permissions = $permissionClass::whereGuardName($guard)->orderBy('name')->pluck('name', $permissionClass->getKeyName());
4949

5050
$body = $permissions->map(fn ($permission, $id) => $roles->map(
5151
fn (array $role_data) => $role_data['permissions']->contains($id) ? '' : ' ·'

0 commit comments

Comments
 (0)