add download button for evenrs and players history

This commit is contained in:
salam committed 2026-08-10 17:01:20 +02:00
1 parent db027c4238
commit 10baadb780
4 files changed
+175

No files matched your search

@@ -3,10 +3,13 @@
namespace App\Filament\Clusters\StaticData\Resources\StatistikoEvents\Pages;
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
use App\Filament\Exports\EventsHistoryExporter;
use App\Models\StatistikoEvent;
use DateTime;
use Filament\Actions\Action;
use Filament\Actions\CreateAction;
use Filament\Actions\ExportAction;
use Filament\Actions\Exports\Models\Export;
use Filament\Resources\Pages\ListRecords;
class ListStatistikoEvents extends ListRecords
@@ -16,6 +19,12 @@ class ListStatistikoEvents extends ListRecords
protected function getHeaderActions(): array
{
return [
ExportAction::make('download_betfair')
->columnMapping(false)
->exporter(EventsHistoryExporter::class)
->label('Download')
->fileName(fn (Export $export): string => 'events-history-'.date('d.m.Y-H.i')."-{$export->getKey()}")
->icon('phosphor-download'),
Action::make('starttime')
->color('gray')
->tooltip('Find events with wrong starttime')
@@ -25,6 +34,7 @@ class ListStatistikoEvents extends ListRecords
->icon('heroicon-o-trash'))
->modalContent(function () {
$events = StatistikoEvent::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
})->action(function () {
$events = StatistikoEvent::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
@@ -3,10 +3,13 @@
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
use App\Filament\Exports\PlayerHistoryExporter;
use App\Models\StatistikoPlayer;
use DateTime;
use Filament\Actions\Action;
use Filament\Actions\CreateAction;
use Filament\Actions\ExportAction;
use Filament\Actions\Exports\Models\Export;
use Filament\Resources\Pages\ListRecords;
class ListStatistikoPlayers extends ListRecords
@@ -16,6 +19,12 @@ class ListStatistikoPlayers extends ListRecords
protected function getHeaderActions(): array
{
return [
ExportAction::make('download_betfair')
->columnMapping(false)
->exporter(PlayerHistoryExporter::class)
->label('Download')
->fileName(fn (Export $export): string => 'player-history-'.date('d.m.Y-H.i')."-{$export->getKey()}")
->icon('phosphor-download'),
Action::make('starttime')
->color('gray')
->tooltip('Find events with wrong starttime')