diff --git a/app/Livewire/ClientGroupListEditor.php b/app/Livewire/ClientGroupListEditor.php index 275d446d..638e59ca 100644 --- a/app/Livewire/ClientGroupListEditor.php +++ b/app/Livewire/ClientGroupListEditor.php @@ -2,7 +2,6 @@ namespace App\Livewire; -use App\Actions\LoadCountryGroups; use App\Models\ClientGroupList; use App\Models\CompetitionGroup; use Filament\Actions\Concerns\InteractsWithActions; @@ -85,7 +84,17 @@ class ClientGroupListEditor extends Component implements HasActions, HasSchemas, ->maxLength(255), Select::make('client_groups') ->searchable() - ->options(fn () => LoadCountryGroups::load()), + ->options(function (): array { + $res = CompetitionGroup::with('country')->get(); + $arr = []; + foreach ($res as $value) { + $arr[$value->id] = $value->country?->name.' '.$value->name; + } + asort($arr, SORT_STRING); + + return $arr; + + }), ]), ]); }