This commit is contained in:
salam committed 2026-09-19 21:50:30 +02:00
1 parent 4e460fba49
commit 02fb8801a5
1 file changed
+9 -1
+9 -1
View File
@@ -17,8 +17,10 @@ use Filament\Forms\Contracts\HasForms;
use Filament\Navigation\NavigationItem; use Filament\Navigation\NavigationItem;
use Filament\Pages\Page; use Filament\Pages\Page;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Livewire\Attributes\On; use Livewire\Attributes\On;
class PlayerProps extends Page implements HasForms class PlayerProps extends Page implements HasForms
@@ -145,9 +147,15 @@ class PlayerProps extends Page implements HasForms
return $arr; return $arr;
} }
}) })
->placeholder('Team')->afterStateUpdated(function ($state) { ->placeholder('Team')
->afterStateUpdated(function ($state, Set $set) {
if ($state) { if ($state) {
$this->dispatch('team-update', team_id: $state); $this->dispatch('team-update', team_id: $state);
$tmp = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $state)->orderBy('created_at', 'desc')->first();
if ($tmp) {
$set('lineup', $tmp->lineup);
$this->dispatch('lineup-update', activeLineUp: $tmp->lineup);
}
} }
}), }),
Select::make('lineup') Select::make('lineup')