wip
This commit is contained in:
1 parent
77eaea5631
commit
6ecee8635a
2 files changed
+43
-15
No files matched your search
@@ -34,7 +34,7 @@ class PlayerProps extends Page implements HasForms
|
||||
->group(static::getNavigationGroup())
|
||||
->icon(static::getNavigationIcon())
|
||||
->activeIcon(static::getActiveNavigationIcon())
|
||||
->isActiveWhen(fn() => request()->routeIs(static::getRouteName()))
|
||||
->isActiveWhen(fn () => request()->routeIs(static::getRouteName()))
|
||||
->sort(static::getNavigationSort())
|
||||
->url(static::getUrl(), shouldOpenInNewTab: true), // 👈 Forces target="_blank"
|
||||
];
|
||||
@@ -58,6 +58,7 @@ class PlayerProps extends Page implements HasForms
|
||||
public string $activeLineUp = '3313';
|
||||
|
||||
public array $players = [];
|
||||
|
||||
public array $clientLineUps = [];
|
||||
|
||||
public int $team_id;
|
||||
@@ -84,46 +85,48 @@ class PlayerProps extends Page implements HasForms
|
||||
->live()
|
||||
->preload()
|
||||
->searchable(false)
|
||||
->prefixIconColor(fn(Get $get): string => $get('cid') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('cid') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-globe-fill')
|
||||
->hiddenLabel()
|
||||
->options(fn() => LoadSofaScoreCategory::load())
|
||||
->options(fn () => LoadSofaScoreCategory::load())
|
||||
->placeholder('Country')
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('lid', null);
|
||||
$set('mid', null);
|
||||
$set('tid', null);
|
||||
$this->dispatch('clear-all');
|
||||
}),
|
||||
Select::make('lid')
|
||||
->live()
|
||||
->preload()
|
||||
->prefixIconColor(fn(Get $get): string => $get('lid') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('lid') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-trophy-fill')
|
||||
->hiddenLabel()
|
||||
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('cid')))
|
||||
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('cid')))
|
||||
->placeholder('League')
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('mid', null);
|
||||
$set('tid', null);
|
||||
$this->dispatch('clear-all');
|
||||
}),
|
||||
Select::make('mid')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->prefixIconColor(fn(Get $get): string => $get('mid') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('mid') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-calendar-check-fill')
|
||||
->options(function (Get $get) {
|
||||
return LoadStatisticFixturesMatchOptions::load($get('lid'));
|
||||
})
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$this->dispatch('match-update', match_id: $state);
|
||||
$set('tid', null);
|
||||
$this->dispatch('match-update', match_id: $state);
|
||||
})
|
||||
->placeholder('Events'),
|
||||
|
||||
Select::make('tid')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->prefixIconColor(fn(Get $get): string => $get('tid') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('tid') ? 'success' : 'danger')
|
||||
->prefixIcon('icon-player')
|
||||
->options(function (Get $get) {
|
||||
if ($get('mid')) {
|
||||
@@ -153,11 +156,13 @@ class PlayerProps extends Page implements HasForms
|
||||
$res = $this->lineUpOptinos();
|
||||
$arr = [];
|
||||
foreach ($res as $key => $value) {
|
||||
if ($this->players && in_array($key, $this->clientLineUps))
|
||||
$arr[$key] = $value . '<span class="text-blue-600"> has lineup</span>';
|
||||
else
|
||||
if ($this->players && in_array($key, $this->clientLineUps)) {
|
||||
$arr[$key] = $value.'<span class="text-blue-600"> has lineup</span>';
|
||||
} else {
|
||||
$arr[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
})
|
||||
->placeholder('LineUp')
|
||||
@@ -181,6 +186,7 @@ class PlayerProps extends Page implements HasForms
|
||||
{
|
||||
$this->players = $players;
|
||||
}
|
||||
|
||||
protected function getFooterWidgets(): array
|
||||
{
|
||||
return [
|
||||
@@ -188,10 +194,12 @@ class PlayerProps extends Page implements HasForms
|
||||
PlayerPropsDrop::make(['players' => $this->players]),
|
||||
];
|
||||
}
|
||||
|
||||
public function getFooterWidgetsColumns(): int|array
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
private function lineUpOptinos(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in new issue
Block a user