diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 1d5c74b6..5723c5df 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -43,11 +43,6 @@ class Statistic extends BaseDashboard 'xl' => 3, ]; - public function getActiveTab() - { - return $this->activeTab; - } - public function getHeading(): string|Htmlable|null { return ''; @@ -67,14 +62,12 @@ class Statistic extends BaseDashboard // '3' => 'Basketball', // '2' => 'Ice Hockey', // '5' => 'Tennis', - // '27' => 'Horse Racing', // ]) // ->icons([ // '1' => 'icon-soccerball', // '3' => 'icon-basketball', // '2' => 'icon-icehockey', // '5' => 'icon-tennisball', - // '27' => 'icon-horseracing', // ]), Grid::make([ 'default' => 1, diff --git a/app/Filament/Widgets/Data/LoadPlayerPerformance.php b/app/Filament/Widgets/Data/LoadPlayerPerformance.php index 1cbe1b43..cd1196a6 100644 --- a/app/Filament/Widgets/Data/LoadPlayerPerformance.php +++ b/app/Filament/Widgets/Data/LoadPlayerPerformance.php @@ -56,7 +56,7 @@ class LoadPlayerPerformance $tmp = []; foreach ($matches_played as $value) { $val = $value->playerrating_value; - $key = round($value->event->starttime->diffInDays(Carbon::now())); + $key = $value->event ? round($value->event->starttime->diffInDays(Carbon::now())) : 0; $tmp["$key"] = $val; } diff --git a/app/Filament/Widgets/StatsMedianAverage.php b/app/Filament/Widgets/StatsMedianAverage.php index e55fb5a4..500e2f57 100644 --- a/app/Filament/Widgets/StatsMedianAverage.php +++ b/app/Filament/Widgets/StatsMedianAverage.php @@ -153,7 +153,7 @@ class StatsMedianAverage extends StatsOverviewWidget $boxes[] = Stat::make('Total', self::template_box2($total_home)) ->description(fn() => new HtmlString($date_events)) ->extraAttributes([ - 'x-init' => "console.log('number-of-events'); animate('number-of-events', $total_home);", + 'x-init' => "animate('number-of-events', $total_home);", 'class' => 'box-info', ]); @@ -177,7 +177,7 @@ class StatsMedianAverage extends StatsOverviewWidget $boxes[] = Stat::make($statistic_type, self::template_box1($expectations_home, $expectations_away)) ->description('Expected Values') ->extraAttributes([ - 'x-init' => "console.log('expectations_home, expectations_away'); animate('expectations_home', $expectations_home); animate('expectations_away', $expectations_away)", + 'x-init' => "animate('expectations_home', $expectations_home); animate('expectations_away', $expectations_away)", 'class' => 'box-yellow', ]); @@ -187,7 +187,7 @@ class StatsMedianAverage extends StatsOverviewWidget $boxes[] = Stat::make('Total', self::template_box2($total_home)) ->description(fn() => new HtmlString($date_events)) ->extraAttributes([ - 'x-init' => "console.log('number-of-events'); animate('number-of-events', $total_home);", + 'x-init' => "animate('number-of-events', $total_home);", 'class' => 'box-info', ]); diff --git a/resources/views/filament/pages/statistic.blade.php b/resources/views/filament/pages/statistic.blade.php index 020e3735..424be537 100644 --- a/resources/views/filament/pages/statistic.blade.php +++ b/resources/views/filament/pages/statistic.blade.php @@ -47,15 +47,17 @@ @livewire(\App\Filament\Widgets\ChartEventPerfMoAv::class, ['filters' => $this->filters]) -
- @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) -
+ @if ($player_name) +
+ @livewire(\App\Filament\Widgets\ChartPlayer::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerMoAv::class, ['filters' => $this->filters]) +
-
- @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) - @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) -
+
+ @livewire(\App\Filament\Widgets\ChartPlayerPerf::class, ['filters' => $this->filters]) + @livewire(\App\Filament\Widgets\ChartPlayerPerfMoAv::class, ['filters' => $this->filters]) +
+ @endif