wip
This commit is contained in:
1 parent
dd51d927dc
commit
bb6986d6e5
6 files changed
+69
-7
No files matched your search
+13
-1
@@ -4,6 +4,7 @@ namespace App\Filament\Clusters\StaticData\Resources\StatisticFixtures\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatisticFixtures\StatisticFixturesResource;
|
||||
use App\Models\StatisticFixtures;
|
||||
use DateTime;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
@@ -14,15 +15,26 @@ class ListStatisticFixtures extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('starttime')
|
||||
->color('gray')
|
||||
->tooltip('Find events with wrong starttime')
|
||||
->icon('phosphor-magnifying-glass')
|
||||
->modalSubmitAction(false)
|
||||
->modalContent(function () {
|
||||
$events = StatisticFixtures::with('league')->with('home')->with('away')->where('starttime', '<', new DateTime('-10 years'))->get();
|
||||
return view('filament.pages.list-fixtures-starttime', ['events' => $events]);
|
||||
}),
|
||||
Action::make('truncate')
|
||||
->icon('phosphor-trash')
|
||||
->tooltip('Delete all events')
|
||||
->requiresConfirmation()
|
||||
->color('danger')
|
||||
->action(function () {
|
||||
StatisticFixtures::truncate();
|
||||
}),
|
||||
Action::make('delete_old')
|
||||
Action::make('delete')
|
||||
->icon('phosphor-trash')
|
||||
->tooltip('Delete events already started')
|
||||
->requiresConfirmation()
|
||||
->color('danger')
|
||||
->action(function () {
|
||||
|
||||
Reference in new issue
Block a user