From cfb8e585ded7ca299dc8fb26a4c027565552a31f Mon Sep 17 00:00:00 2001 From: Charlie Etienne Date: Tue, 19 Mar 2024 18:58:01 +0100 Subject: [PATCH 1/2] Replace splat operator with union operator --- src/Resources/AnnouncementResource.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Resources/AnnouncementResource.php b/src/Resources/AnnouncementResource.php index 9005870..1e9783f 100644 --- a/src/Resources/AnnouncementResource.php +++ b/src/Resources/AnnouncementResource.php @@ -51,10 +51,7 @@ public static function form(Form $form): Form ->rgb(), Select::make('users') - ->options([ - 'all' => 'all', - ...User::all()->pluck('name', 'id'), - ]) + ->options(['all' => 'all'] + User::all()->pluck('name', 'id')) ->multiple() ->required(), ]); From d524c4ecfbf5859ec83e5950057253e15cd97fb1 Mon Sep 17 00:00:00 2001 From: Charlie Etienne Date: Tue, 19 Mar 2024 19:27:33 +0100 Subject: [PATCH 2/2] Update AnnouncementResource.php --- src/Resources/AnnouncementResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/AnnouncementResource.php b/src/Resources/AnnouncementResource.php index 1e9783f..14408b2 100644 --- a/src/Resources/AnnouncementResource.php +++ b/src/Resources/AnnouncementResource.php @@ -51,7 +51,7 @@ public static function form(Form $form): Form ->rgb(), Select::make('users') - ->options(['all' => 'all'] + User::all()->pluck('name', 'id')) + ->options(['all' => 'all'] + User::all()->pluck('name', 'id')->toArray()) ->multiple() ->required(), ]);