fix box 1
This commit is contained in:
1 parent
4ec3a86c9e
commit
c49f5e2364
7 files changed
+230
-194
No files matched your search
@@ -79,10 +79,11 @@ class Statistic extends BaseDashboard
|
||||
Select::make('sofascore_category_id')
|
||||
->live()
|
||||
->preload()
|
||||
->prefixIconColor(fn(Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
|
||||
->searchable(false)
|
||||
->prefixIconColor(fn (Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-globe-fill')
|
||||
->hiddenLabel()
|
||||
->options(fn() => LoadSofaScoreCategory::load())
|
||||
->options(fn () => LoadSofaScoreCategory::load())
|
||||
->placeholder('Country')
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('league_id', null);
|
||||
@@ -94,11 +95,11 @@ class Statistic extends BaseDashboard
|
||||
Select::make('league_id')
|
||||
->live()
|
||||
->preload()
|
||||
->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-trophy-fill')
|
||||
->hiddenLabel()
|
||||
// ->options(fn(Get $get) => SofaScoreTournament::with('sofascore_category')->where('sofa_score_category_id', $get('sofascore_category_id'))->pluck('name', 'tournament_id'))
|
||||
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
||||
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
||||
->placeholder('League')
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('match_id', null);
|
||||
@@ -109,7 +110,7 @@ class Statistic extends BaseDashboard
|
||||
Select::make('match_id')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger')
|
||||
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-calendar-check-fill')
|
||||
->options(function (Get $get) {
|
||||
return LoadStatisticFixturesMatchOptions::load($get('league_id'));
|
||||
@@ -133,7 +134,7 @@ class Statistic extends BaseDashboard
|
||||
}
|
||||
})
|
||||
->prefixIcon('phosphor-users-three-fill')
|
||||
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->options(function (Get $get) {
|
||||
if ($get('match_id')) {
|
||||
$res = StatisticFixtures::where('id', $get('match_id'))->first();
|
||||
@@ -161,9 +162,9 @@ class Statistic extends BaseDashboard
|
||||
Action::make('iconInfo')
|
||||
->color('success')
|
||||
->icon('phosphor-question-fill')
|
||||
->tooltip(fn() => 'Team Position')
|
||||
->tooltip(fn () => 'Team Position')
|
||||
)
|
||||
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->default('all')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
@@ -216,13 +217,13 @@ class Statistic extends BaseDashboard
|
||||
->hiddenLabel()
|
||||
->prefix('SPM')
|
||||
->placeholder('Similar Past Matches')
|
||||
->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± ' . $get('accuracy') . '</div>') : '')
|
||||
->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± '.$get('accuracy').'</div>') : '')
|
||||
->prefixAction(
|
||||
Action::make('iconInfo')
|
||||
->icon('phosphor-question-fill')
|
||||
// ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary')
|
||||
->color('success')
|
||||
->tooltip(fn() => $this->tooltip_similar_past_matches())
|
||||
->tooltip(fn () => $this->tooltip_similar_past_matches())
|
||||
)
|
||||
->default('none')
|
||||
->selectablePlaceholder(false)
|
||||
@@ -239,7 +240,7 @@ class Statistic extends BaseDashboard
|
||||
Slider::make('accuracy')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->hidden(fn(Get $get) => $get('similar_past_matches') == 'none')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
|
||||
->fillTrack()
|
||||
->minValue(0)
|
||||
->maxValue(0.25)
|
||||
@@ -258,17 +259,17 @@ class Statistic extends BaseDashboard
|
||||
->hiddenLabel()
|
||||
->allowHtml()
|
||||
->placeholder('Player')
|
||||
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
|
||||
->prefixIconColor(fn(Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
||||
->prefixIcon('icon-player')
|
||||
->preload()
|
||||
->searchable()
|
||||
->extraAttributes(fn() => ['id' => 'player_selector'])
|
||||
->extraAttributes(fn () => ['id' => 'player_selector'])
|
||||
->suffixAction(
|
||||
Action::make('iconInfo')
|
||||
->icon('phosphor-question-fill')
|
||||
->color('success')
|
||||
->tooltip(fn() => $this->tooltip_player_info())
|
||||
->tooltip(fn () => $this->tooltip_player_info())
|
||||
)
|
||||
->options(function (Get $get) {
|
||||
return LoadPlayer::load($get);
|
||||
@@ -279,7 +280,7 @@ class Statistic extends BaseDashboard
|
||||
->placeholder('Time on field')
|
||||
->prefixIcon('phosphor-watch-fill')
|
||||
->default('all')
|
||||
->hidden(fn(Get $get) => ! $get('ss_player_id'))
|
||||
->hidden(fn (Get $get) => ! $get('ss_player_id'))
|
||||
->prefixIconColor('success')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
@@ -314,47 +315,52 @@ class Statistic extends BaseDashboard
|
||||
Select::make('season')
|
||||
->live()
|
||||
->columns(2)
|
||||
->searchable(false)
|
||||
->hiddenLabel()
|
||||
->multiple()
|
||||
->placeholder('Current Season')
|
||||
->prefixIconColor('success')
|
||||
// ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
|
||||
->hidden(fn(Get $get) => $get('season_or_date') == 'date')
|
||||
->hidden(fn (Get $get) => $get('season_or_date') == 'date')
|
||||
->prefixIcon('phosphor-calendar-star-fill')
|
||||
->preload()
|
||||
->options(function (Get $get) {
|
||||
return LoadSeasons::load($get('league_id'));
|
||||
})
|
||||
->options([
|
||||
'26/27' => '26/27',
|
||||
'25/26' => '25/26',
|
||||
'24/25' => '24/25',
|
||||
])
|
||||
// ->options(function (Get $get) {
|
||||
// return LoadSeasons::load($get('league_id'));
|
||||
// })
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('ss_player_id', null);
|
||||
}),
|
||||
DatePicker::make('start_date')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->hidden(fn(Get $get) => $get('season_or_date') == 'season')
|
||||
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||
->native(false)
|
||||
->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary')
|
||||
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
|
||||
->prefixIcon('phosphor-calendar-fill')
|
||||
->prefix('Start')
|
||||
->suffixAction(
|
||||
Action::make('clear_start')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn(Set $set) => $set('start_date', null))
|
||||
->action(fn (Set $set) => $set('start_date', null))
|
||||
),
|
||||
DatePicker::make('end_date')
|
||||
->live()
|
||||
->hiddenLabel()
|
||||
->hidden(fn(Get $get) => $get('season_or_date') == 'season')
|
||||
->hidden(fn (Get $get) => $get('season_or_date') == 'season')
|
||||
->native(false)
|
||||
->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary')
|
||||
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
|
||||
->prefixIcon('phosphor-calendar-fill')
|
||||
->prefix('End')
|
||||
->suffixAction(
|
||||
Action::make('clear_end')
|
||||
->icon('phosphor-x')
|
||||
->color('gray')
|
||||
->action(fn(Set $set) => $set('end_date', null))
|
||||
->action(fn (Set $set) => $set('end_date', null))
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user