design changes to save space

This commit is contained in:
salam committed 2026-05-31 12:13:22 +02:00
1 parent 4b06f98bee
commit fcbf718492
10 files changed
+319 -304

No files matched your search

+57 -34
View File
@@ -73,10 +73,9 @@ class Statistic extends BaseDashboard
return $schema return $schema
->components([ ->components([
Grid::make([ Grid::make([
'default' => 2, 'default' => 1,
'sm' => 2, 'sm' => 2,
'md' => 3, 'md' => 4,
'lg' => 4,
]) ])
->columnSpanFull() ->columnSpanFull()
->extraAttributes([ ->extraAttributes([
@@ -84,17 +83,21 @@ class Statistic extends BaseDashboard
]) ])
->schema([ ->schema([
Select::make('league_id') Select::make('league_id')
->prefixIconColor('primary') // ->prefixIconColor('primary')
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy') ->prefixIcon('phosphor-trophy')
->hiddenLabel()
->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1)) ->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1))
->live() ->live()
->label('League') ->placeholder('League')
->afterStateUpdated(function (callable $set, $state) { ->afterStateUpdated(function (callable $set, $state) {
$set('match_id', null); $set('match_id', null);
$set('team_id', null);
$this->dispatch('filterChanged', filterValue: $state); $this->dispatch('filterChanged', filterValue: $state);
}), }),
Select::make('match_id') Select::make('match_id')
->prefixIconColor('primary') ->hiddenLabel()
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-check') ->prefixIcon('phosphor-calendar-check')
->options(function (Get $get) { ->options(function (Get $get) {
return LoadStatisticFixturesMatchOptions::load($get('league_id')); return LoadStatisticFixturesMatchOptions::load($get('league_id'));
@@ -104,9 +107,20 @@ class Statistic extends BaseDashboard
$set('tm_player_id', null); $set('tm_player_id', null);
}) })
->live() ->live()
->label('Events'), ->placeholder('Events'),
Select::make('team_id') Select::make('team_id')
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '') ->hiddenLabel()
->prefixIconColor(function (Get $get): string {
if ($get('team_id')) {
return 'success';
} elseif ($get('similar_past_matches') != 'none') {
return 'gray';
} else {
return 'danger';
}
})
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
->prefixIcon('phosphor-users-three') ->prefixIcon('phosphor-users-three')
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none') ->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) { ->options(function (Get $get) {
@@ -125,10 +139,13 @@ class Statistic extends BaseDashboard
$set('tm_player_id', null); $set('tm_player_id', null);
}) })
->live() ->live()
->label('Team'), ->placeholder('Team'),
Select::make('team_position') Select::make('team_position')
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '') ->hiddenLabel()
->placeholder('Positiom')
->prefix('Positiom')
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
->prefixIcon('phosphor-map-pin') ->prefixIcon('phosphor-map-pin')
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none') ->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
->default('all') ->default('all')
@@ -140,10 +157,12 @@ class Statistic extends BaseDashboard
]), ]),
DatePicker::make('start_date') DatePicker::make('start_date')
->hiddenLabel()
->native(false) ->native(false)
->prefixIconColor('primary') // ->prefixIconColor('primary')
->prefixIcon('phosphor-calendar') ->prefixIcon('phosphor-calendar')
->live() ->live()
->prefix('Start')
->suffixAction( ->suffixAction(
Action::make('clear_start') Action::make('clear_start')
->icon('phosphor-x') ->icon('phosphor-x')
@@ -151,10 +170,12 @@ class Statistic extends BaseDashboard
->action(fn (Set $set) => $set('start_date', null)) ->action(fn (Set $set) => $set('start_date', null))
), ),
DatePicker::make('end_date') DatePicker::make('end_date')
->hiddenLabel()
->native(false) ->native(false)
->prefixIconColor('primary') // ->prefixIconColor('primary')
->prefixIcon('phosphor-calendar') ->prefixIcon('phosphor-calendar')
->live() ->live()
->prefix('End')
->suffixAction( ->suffixAction(
Action::make('clear_end') Action::make('clear_end')
->icon('phosphor-x') ->icon('phosphor-x')
@@ -162,12 +183,10 @@ class Statistic extends BaseDashboard
->action(fn (Set $set) => $set('end_date', null)) ->action(fn (Set $set) => $set('end_date', null))
), ),
Select::make('statistic_type') Select::make('statistic_type')
->columnSpan([ ->hiddenLabel()
'default' => 1, ->placeholder('Statistic Type')
'xl' => 2, ->prefixIconColor('success')
]) ->prefixIcon('phosphor-arrows-out-line-vertical')
->prefixIconColor('primary')
->prefixIcon('phosphor-dots-three-outline')
->default('none') ->default('none')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->options([ ->options([
@@ -180,8 +199,14 @@ class Statistic extends BaseDashboard
'tsh' => 'Total shots', 'tsh' => 'Total shots',
]), ]),
Select::make('similar_past_matches') Select::make('similar_past_matches')
->hiddenLabel()
->placeholder('Similar Past Matches')
->prefixIconColor('primary') ->prefixIconColor('primary')
->prefixIcon('phosphor-approximate-equals') ->prefixIcon('phosphor-approximate-equals')
->columnSpan([
'default' => 1,
'xl' => 2,
])
->suffixAction( ->suffixAction(
Action::make('iconInfo') Action::make('iconInfo')
->color('gray') ->color('gray')
@@ -196,25 +221,30 @@ class Statistic extends BaseDashboard
$set('tm_player_id', null); $set('tm_player_id', null);
}) })
->options([ ->options([
'none' => 'None', 'none' => 'Similar Past Matches: None',
'league' => 'League', 'league' => 'Similar Past Matches: League',
'all' => 'All Database', 'all' => 'Similar Past Matches All: Database',
]), ]),
Slider::make('accuracy') Slider::make('accuracy')
->label('Accuracy max: 0.25, steps: 0.025') ->label('Accuracy max: 0.25, steps: 0.025')
->hiddenLabel() ->hiddenLabel()
->disabled(fn (Get $get) => $get('similar_past_matches') == 'none') ->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
// ->fillTrack() // ->fillTrack()
->range(minValue: 0, maxValue: 0.25) ->range(minValue: 0, maxValue: 0.25)
->step(0.025) ->step(0.025)
->decimalPlaces(1) ->decimalPlaces(1)
->decimalPlaces(3) ->decimalPlaces(3)
->tooltips() ->tooltips()
->columnSpan([
'default' => 1,
'xl' => 2,
])
// ->pips() // ->pips()
->live(), ->live(),
Select::make('tm_player_id') Select::make('tm_player_id')
->label('Player') ->hiddenLabel()
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none') ->placeholder('Player')
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '') ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
->prefixIcon('icon-player') ->prefixIcon('icon-player')
->suffixAction( ->suffixAction(
@@ -232,10 +262,11 @@ class Statistic extends BaseDashboard
}) })
->live(), ->live(),
Select::make('player_on_field') Select::make('player_on_field')
->label('Time on field') ->hiddenLabel()
->placeholder('Time on field')
->prefixIcon('phosphor-watch') ->prefixIcon('phosphor-watch')
->default('all') ->default('all')
->disabled(fn (Get $get) => ! $get('tm_player_id') or $get('similar_past_matches') != 'none') ->hidden(fn (Get $get) => ! $get('tm_player_id') or $get('similar_past_matches') != 'none')
->prefixIconColor(fn (Get $get): string => ($get('tm_player_id') and $get('similar_past_matches') == 'none') ? 'primary' : '') ->prefixIconColor(fn (Get $get): string => ($get('tm_player_id') and $get('similar_past_matches') == 'none') ? 'primary' : '')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->options([ ->options([
@@ -248,14 +279,6 @@ class Statistic extends BaseDashboard
]); ]);
} }
public function getFooterWidgetsColumns(): int|array
{
return [
'default' => 1,
'md' => 2,
];
}
protected function tooltip_similar_past_matches(): HtmlString protected function tooltip_similar_past_matches(): HtmlString
{ {
$str = '<div class="grid grid-cols-4 gap-4 max-w-lg">'; $str = '<div class="grid grid-cols-4 gap-4 max-w-lg">';
+5 -1
View File
@@ -2,6 +2,7 @@
namespace App\Filament\Widgets; namespace App\Filament\Widgets;
use App\Filament\Widgets\Data\HelperStatisticType;
use App\Filament\Widgets\Data\LoadPlayer; use App\Filament\Widgets\Data\LoadPlayer;
use Filament\Support\RawJs; use Filament\Support\RawJs;
use Filament\Widgets\ChartWidget; use Filament\Widgets\ChartWidget;
@@ -25,7 +26,10 @@ class ChartPlayer extends ChartWidget
$data = LoadPlayer::load($this->filters); $data = LoadPlayer::load($this->filters);
if ($data) { if ($data) {
$this->description = $data['player_name']; $this->description = ucfirst(HelperStatisticType::get($this->filters));
if ($data['player_name']) {
$this->description .= ' '.$data['player_name'];
}
} }
return $data; return $data;
+41 -78
View File
@@ -28,6 +28,8 @@ class LoadPlayer
$end = $filter['end_date'] ?? 0; $end = $filter['end_date'] ?? 0;
$statistic_type = $filter['statistic_type'];
$team_position = $filter['team_position']; $team_position = $filter['team_position'];
if (! $league_id) { if (! $league_id) {
@@ -40,101 +42,62 @@ class LoadPlayer
return []; return [];
} }
if ($statistic_type == 'none') {
$statistic_type = 'gls';
}
$player_name = StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name'); $player_name = StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name');
$res = StatistikoPlayer::with('event.home')->with('event.away')->where('tm_player_id', (int) $tm_player_id)->get(); $res = StatistikoPlayer::with('event')->where('tm_player_id', (int) $tm_player_id)->get();
$labels = []; $labels = [];
$playing_date = []; $datasets = [];
$events = [];
$datasets_goals = [];
$datasets_fouls = [];
$datasets_offside = [];
$datasets_card = [];
$datasets_shots_on = [];
$datasets_shots_off = [];
foreach ($res as $value) { foreach ($res as $value) {
// dd($value);
$val = 0;
if (isset($value->event->starttime)) { if (isset($value->event->starttime)) {
// $labels[] = $value->event->starttime->format('d.M.y');
$labels[] = round($value->event->starttime->diffInDays(Carbon::now())); $labels[] = round($value->event->starttime->diffInDays(Carbon::now()));
$events[] = $value->event->home->name.' vs '.$value->event->away->name; switch ($statistic_type) {
case 'gls':
$playing_date[] = $value->event->starttime->format('d. F Y H:i'); $val = (int) $value->goals;
break;
$datasets_goals[] = (int) $value->goals; case 'crn':
$val = (int) 0;
$datasets_fouls[] = (int) $value->fouls; break;
case 'fls':
$datasets_offside[] = (int) $value->offsides; $val = (int) $value->fouls;
break;
$datasets_card[] = (int) $value->card_yellow + $value->card_red + $value->card_yellowred; case 'ofs':
$val = (int) $value->offsides;
$datasets_shots_on[] = (int) $value->shots_on_target; break;
case 'crd':
$datasets_shots_off[] = (int) $value->shots_off_target; $val = (int) $value->card_yellow + $value->card_red + $value->card_yellowred;
break;
case 'snt':
$val = (int) $value->shots_on_target;
break;
case 'tsh':
$val = (int) $value->shots_off_target;
break;
}
} }
$datasets[] = $val;
} }
$data = [ $data = [
'datasets' => [ 'datasets' => [
[ [
'label' => 'Goals', 'label' => ucfirst($team_position),
'data' => $datasets_goals, 'data' => $datasets,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5, 'tension' => 0.5,
'borderColor' => '#fb2c36', 'borderColor' => '#36A2EB',
'backgroundColor' => '#fb2c36',
],
[
'label' => 'Fouls Commited',
'data' => $datasets_fouls,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#f0b100',
'backgroundColor' => '#f0b100',
'dates' => $playing_date,
'events' => $events,
],
[
'label' => 'Offside',
'data' => $datasets_offside,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#7ccf00',
'backgroundColor' => '#7ccf00',
],
[
'label' => 'Cards',
'data' => $datasets_card,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#00b8db',
'backgroundColor' => '#00b8db',
],
[
'label' => 'Shots On Target',
'data' => $datasets_shots_on,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#615fff',
'backgroundColor' => '#615fff',
],
[
'label' => 'Shots Off Target',
'data' => $datasets_shots_off,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#e12afb',
'backgroundColor' => '#e12afb',
], ],
], ],
'labels' => $labels, 'labels' => $labels,
@@ -1,107 +0,0 @@
<?php
namespace App\Filament\Widgets\Data;
use App\Models\StatistikoPlayer;
use Illuminate\Support\Carbon;
class LoadPlayer
{
public static $last_query = [];
public static function load($filter)
{
// dd($filter);
if (self::$last_query) {
return self::$last_query;
}
$league_id = (int) $filter['league_id'] ?? 0;
$team_id = (int) $filter['team_id'] ?? 0;
$tm_player_id = (int) $filter['tm_player_id'] ?? 0;
$start = $filter['start_date'] ?? 0;
$end = $filter['end_date'] ?? 0;
$statistic_type = $filter['statistic_type'];
$team_position = $filter['team_position'];
if (! $league_id) {
return [];
}
if (! $team_id) {
return [];
}
if (! $tm_player_id) {
return [];
}
if ($statistic_type == 'none') {
$statistic_type = 'gls';
}
$res = StatistikoPlayer::with('event')->where('tm_player_id', (int) $tm_player_id)->get();
$labels = [];
$datasets = [];
foreach ($res as $value) {
// dd($value);
$val = 0;
if (isset($value->event->starttime)) {
// $labels[] = $value->event->starttime->format('d.M.y');
$labels[] = round($value->event->starttime->diffInDays(Carbon::now()));
switch ($statistic_type) {
case 'gls':
$val = (int) $value->goals;
break;
case 'crn':
$val = (int) 0;
break;
case 'fls':
$val = (int) $value->fouls;
break;
case 'ofs':
$val = (int) $value->offsides;
break;
case 'crd':
$val = (int) $value->card_yellow + $value->card_red + $value->card_yellowred;
break;
case 'snt':
$val = (int) $value->shots_on_target;
break;
case 'tsh':
$val = (int) $value->shots_off_target;
break;
}
}
$datasets[] = $val;
}
$data = [
'datasets' => [
[
'label' => ucfirst($team_position),
'data' => $datasets,
'tension' => 0.5,
'borderColor' => '#36A2EB',
],
],
'labels' => $labels,
];
self::$last_query = $data;
return $data;
}
}
@@ -0,0 +1,148 @@
<?php
namespace App\Filament\Widgets\Data;
use App\Models\StatistikoDetail;
use App\Models\StatistikoPlayer;
use Illuminate\Support\Carbon;
class LoadPlayerMulti
{
public static $last_query = [];
public static function load($filter)
{
// dd($filter);
if (self::$last_query) {
return self::$last_query;
}
$league_id = (int) $filter['league_id'] ?? 0;
$team_id = (int) $filter['team_id'] ?? 0;
$tm_player_id = (int) $filter['tm_player_id'] ?? 0;
$start = $filter['start_date'] ?? 0;
$end = $filter['end_date'] ?? 0;
$team_position = $filter['team_position'];
if (! $league_id) {
return [];
}
if (! $team_id) {
return [];
}
if (! $tm_player_id) {
return [];
}
$player_name = StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name');
$res = StatistikoPlayer::with('event.home')->with('event.away')->where('tm_player_id', (int) $tm_player_id)->get();
$labels = [];
$playing_date = [];
$events = [];
$datasets_goals = [];
$datasets_fouls = [];
$datasets_offside = [];
$datasets_card = [];
$datasets_shots_on = [];
$datasets_shots_off = [];
foreach ($res as $value) {
if (isset($value->event->starttime)) {
$labels[] = round($value->event->starttime->diffInDays(Carbon::now()));
$events[] = $value->event->home->name.' vs '.$value->event->away->name;
$playing_date[] = $value->event->starttime->format('d. F Y H:i');
$datasets_goals[] = (int) $value->goals;
$datasets_fouls[] = (int) $value->fouls;
$datasets_offside[] = (int) $value->offsides;
$datasets_card[] = (int) $value->card_yellow + $value->card_red + $value->card_yellowred;
$datasets_shots_on[] = (int) $value->shots_on_target;
$datasets_shots_off[] = (int) $value->shots_off_target;
}
}
$data = [
'datasets' => [
[
'label' => 'Goals',
'data' => $datasets_goals,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#fb2c36',
'backgroundColor' => '#fb2c36',
],
[
'label' => 'Fouls Commited',
'data' => $datasets_fouls,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#f0b100',
'backgroundColor' => '#f0b100',
'dates' => $playing_date,
'events' => $events,
],
[
'label' => 'Offside',
'data' => $datasets_offside,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#7ccf00',
'backgroundColor' => '#7ccf00',
],
[
'label' => 'Cards',
'data' => $datasets_card,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#00b8db',
'backgroundColor' => '#00b8db',
],
[
'label' => 'Shots On Target',
'data' => $datasets_shots_on,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#615fff',
'backgroundColor' => '#615fff',
],
[
'label' => 'Shots Off Target',
'data' => $datasets_shots_off,
'dates' => $playing_date,
'events' => $events,
'tension' => 0.5,
'borderColor' => '#e12afb',
'backgroundColor' => '#e12afb',
],
],
'labels' => $labels,
'player_name' => $player_name,
];
self::$last_query = $data;
return $data;
}
}
+47 -35
View File
@@ -24,7 +24,8 @@ class StatsMedianAverage extends StatsOverviewWidget
public function getColumns(): int|array public function getColumns(): int|array
{ {
return [ return [
'md' => 3, 'default' => 2,
'sm' => 3,
'xl' => 6, 'xl' => 6,
]; ];
} }
@@ -39,67 +40,78 @@ class StatsMedianAverage extends StatsOverviewWidget
return []; return [];
} }
$arr = $data['datasets'][0]['data']; $arr_home = $data['datasets'][0]['data'];
$arr2 = $data['datasets'][1]['data']; $arr_away = $data['datasets'][1]['data'];
$total = count($arr); $total_home = count($arr_home);
$summe = array_sum($arr); $total_away = count($arr_away);
$summe2 = array_sum($arr2); $summe_home = array_sum($arr_home);
$summe_away = array_sum($arr_away);
$home_team = $data['home_team']; $home_team = $data['home_team'];
$away_team = $data['away_team']; $away_team = $data['away_team'];
if (! $total) { if (! $total_home) {
return []; return [];
} }
// if (! $total_home || ! $total_away) {
// return [];
// }
sort($arr); sort($arr_home);
sort($arr2); sort($arr_away);
if ($total % 2 == 0) { if ($total_home % 2 == 0) {
// even // even
$m = $total / 2; $m = $total_home / 2;
$m1 = floor($m); $m1 = floor($m);
$m2 = ceil($m); $m2 = ceil($m);
$median = round(($arr[$m1] + $arr[$m2]) / 2, 2); $median_home = round(($arr_home[$m1] + $arr_home[$m2]) / 2, 2);
$median2 = round(($arr2[$m1] + $arr2[$m2]) / 2, 2); $m = $total_away / 2;
$m1 = floor($m);
$m2 = ceil($m);
$median_away = round(($arr_away[$m1] + $arr_away[$m2]) / 2, 2);
} else { } else {
// odd // odd
$m = floor($total / 2); $m = $total_home / 2;
$median = $arr[$m]; $median_home = $arr_home[$m];
$median2 = $arr2[$m]; $m = floor($total_away / 2);
$median_away = $arr_away[$m];
} }
$win = $data['results']['w'] ? number_format(Round::odd($total / $data['results']['w']), 2) : 0; $win = $data['results']['w'] ? number_format(Round::odd($total_home / $data['results']['w']), 2) : 0;
$draw = $data['results']['d'] ? number_format(Round::odd($total / $data['results']['d']), 2) : 0; $draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
$lost = $data['results']['l'] ? number_format(Round::odd($total / $data['results']['l']), 2) : 0; $lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
return [ return [
Stat::make('Number of events', $total)->extraAttributes([ Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
'class' => 'text-xl bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800', 'titel' => 'Number of events',
'value' => $total_home,
]), ]),
Stat::make('Average', 'Average')->view('filament.resources.events.widgets.statistic-average', [ Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Average '.$statistic_type, 'titel' => 'Average '.$statistic_type,
'infavour' => number_format($summe / $total, 1), 'value1' => number_format($summe_home / $total_home, 1),
'against' => number_format($summe2 / $total, 1), 'value2' => number_format($summe_away / $total_away, 1),
'home' => $home_team, 'home' => $home_team,
'away' => $away_team, 'away' => $away_team,
]), ]),
Stat::make('Median', 'Median')->view('filament.resources.events.widgets.statistic-average', [ Stat::make('stat3', 'stat3')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Median '.$statistic_type, 'titel' => 'Median '.$statistic_type,
'infavour' => $median, 'value1' => $median_home,
'against' => $median2, 'value2' => $median_away,
'home' => $home_team, 'home' => $home_team,
'away' => $away_team, 'away' => $away_team,
]), ]),
Stat::make('Win: '.$data['results']['w'], $win) Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
->extraAttributes([ 'titel' => 'Win: '.$data['results']['w'],
'class' => 'bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800', 'value' => $win,
]),
Stat::make('Draw: '.$data['results']['d'], $draw)->extraAttributes([
'class' => 'bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800',
]), ]),
Stat::make('Lost: '.$data['results']['l'], $lost)->extraAttributes([ Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
'class' => 'bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800', 'titel' => 'Draw: '.$data['results']['d'],
'value' => $draw,
]),
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Lost: '.$data['results']['l'],
'value' => $lost,
]), ]),
]; ];
} }
Generated
+6 -6
View File
@@ -6581,16 +6581,16 @@
}, },
{ {
"name": "spatie/laravel-permission", "name": "spatie/laravel-permission",
"version": "7.4.1", "version": "7.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/laravel-permission.git", "url": "https://github.com/spatie/laravel-permission.git",
"reference": "ef42ecb781e5534d368a3853fa161e420ad51397" "reference": "15a9daf02ba02d3ae77aaa6da582708231ef999b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-permission/zipball/ef42ecb781e5534d368a3853fa161e420ad51397", "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/15a9daf02ba02d3ae77aaa6da582708231ef999b",
"reference": "ef42ecb781e5534d368a3853fa161e420ad51397", "reference": "15a9daf02ba02d3ae77aaa6da582708231ef999b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -6656,7 +6656,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/spatie/laravel-permission/issues", "issues": "https://github.com/spatie/laravel-permission/issues",
"source": "https://github.com/spatie/laravel-permission/tree/7.4.1" "source": "https://github.com/spatie/laravel-permission/tree/7.4.2"
}, },
"funding": [ "funding": [
{ {
@@ -6664,7 +6664,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-04-29T07:59:45+00:00" "time": "2026-05-30T19:21:26+00:00"
}, },
{ {
"name": "spatie/shiki-php", "name": "spatie/shiki-php",
@@ -1,11 +1,12 @@
<x-filament-panels::page> <x-filament-panels::page>
{{ $this->filtersForm }} {{ $this->filtersForm }}
@livewire(\App\Filament\Widgets\StatsMedianAverage::class, ['filters' => $this->filters]) @livewire(\App\Filament\Widgets\StatsMedianAverage::class, ['filters' => $this->filters])
<div x-data="{ activeTab: 'tab1' }"> <div x-data="{ activeTab: 'tab1' }">
<!-- Tab Navigation --> <!-- Tab Navigation -->
<x-filament::tabs label="Statistics" class="mb-6 justify-center"> <x-filament::tabs label="Statistics" class="mb-4 justify-center rounded-lg grid grid-cols-2 md:grid-cols-4">
<x-filament::tabs.item x-on:click="activeTab = 'tab1'" :alpine-active="'activeTab === \'' . 'tab1' . '\''" icon="phosphor-trophy"> <x-filament::tabs.item x-on:click="activeTab = 'tab1'" :alpine-active="'activeTab === \'' . 'tab1' . '\''" icon="phosphor-trophy">
Events Events
</x-filament::tabs.item> </x-filament::tabs.item>
@@ -24,7 +25,7 @@
</x-filament::tabs> </x-filament::tabs>
<!-- Tab Content --> <!-- Tab Content -->
<div class="mt-6"> <div class="mt-2">
<!-- Content for Tab 1 --> <!-- Content for Tab 1 -->
<div x-show="activeTab === 'tab1'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4"> <div x-show="activeTab === 'tab1'" x-cloak class="grid grid-cols-1 md:grid-cols-2 gap-4">
@livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters]) @livewire(\App\Filament\Widgets\ChartEvent::class, ['filters' => $this->filters])
@@ -1,24 +1,11 @@
<div class="fi-sc-component "> <div class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
<div class="fi-wi-stats-overview-stat bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800"> <span class="font-bold flex items-center justify-center">{{ $titel }}</span>
<div class="fi-wi-stats-overview-stat-content"> <div class="grid grid-cols-2 justify-center font-bold text-2xl">
<div class="fi-wi-stats-overview-stat-label-ctn"> <span class="font-bold text-2xl flex items-center justify-center">{{ $value1 }}</span>
<span class="fi-wi-stats-overview-stat-label"> <span class="font-bold text-2xl flex items-center justify-center">{{ $value2 }}</span>
{{ $titel }} </div>
</span> <div class="grid grid-cols-2 justify-center">
</div> <span class=" flex items-center justify-center text-xs">{{ $home }}</span>
<span class=" flex items-center justify-center text-xs">{{ $away }}</span>
<div class="fi-wi-stats-overview-stat-value grid grid-cols-2 justify-center">
<div class="text-center">{{ $infavour }}</div>
<div class="text-center">{{ $against }}</div>
</div>
<div class="fi-wi-stats-overview-stat-description grid grid-cols-2 justify-center">
<div class="text-center">{{ $home }}</div>
<div class="text-center">{{ $away }}</div>
</div>
</div>
</div> </div>
</div> </div>
@@ -1,20 +1,4 @@
<div class="fi-sc-component "> <div class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
<div class="fi-wi-stats-overview-stat bg-green-100 dark:bg-green-950 border border-green-300 dark:border-green-800"> <span class="font-bold flex items-center justify-center">{{ $titel }}</span>
<div class="fi-wi-stats-overview-stat-content"> <span class="font-bold text-2xl flex items-center justify-center">{{ $value }}</span>
<div class="fi-wi-stats-overview-stat-label-ctn">
<span class="fi-wi-stats-overview-stat-label text-xl font-bold mx-auto">
{{ $titel }}
</span>
</div>
<div class="fi-wi-stats-overview-stat-value text-center">
{{ $value }}
</div>
<div class="fi-wi-stats-overview-stat-description">
<div class="text-center"></div>
</div>
</div>
</div>
</div> </div>