wip delete wron starttime in events
This commit is contained in:
1 parent
8683313dbc
commit
b72b14811a
2 files changed
+108
-91
No files matched your search
+14
-1
@@ -20,10 +20,23 @@ class ListStatistikoEvents extends ListRecords
|
||||
->color('gray')
|
||||
->tooltip('Find events with wrong starttime')
|
||||
->icon('phosphor-magnifying-glass')
|
||||
->modalSubmitAction(false)
|
||||
->modalSubmitAction(fn(Action $action) => $action->label('Delete all')
|
||||
->color('danger')
|
||||
->icon('heroicon-o-trash'))
|
||||
// ->modalSubmitAction(
|
||||
// fn(\Filament\Actions\StaticAction $action) =>
|
||||
// $action->color('danger')
|
||||
// ->icon('heroicon-o-trash')
|
||||
// )
|
||||
// ->modalSubmitActionLabel('Delete')
|
||||
->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();
|
||||
foreach ($events as $value) {
|
||||
StatistikoEvent::where('match_id', $value->match_id)->delete();
|
||||
}
|
||||
}),
|
||||
Action::make('truncate')
|
||||
->icon('phosphor-trash')
|
||||
|
||||
Reference in new issue
Block a user