From d03a7ba7cd1fe4639b9fe3b39adb3b33febfdcf8 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Tue, 27 Feb 2024 19:15:45 +0330 Subject: [PATCH] Update RoleResource (#166) --- src/Resources/RoleResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/RoleResource.php b/src/Resources/RoleResource.php index 5ee9102..27c6417 100644 --- a/src/Resources/RoleResource.php +++ b/src/Resources/RoleResource.php @@ -99,7 +99,7 @@ public static function form(Form $form): Form ->label(__('filament-spatie-roles-permissions::filament-spatie.field.permissions')) ->relationship( name: 'permissions', - modifyQueryUsing: fn (Builder $query) => $query->orderBy('name')->orderBy('name'), + modifyQueryUsing: fn (Builder $query) => $query->orderBy('name'), ) ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->name} ({$record->guard_name})") ->searchable(['name', 'guard_name']) // searchable on both name and guard_name