wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoEvents\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateStatistikoEvents extends CreateRecord
|
||||
{
|
||||
protected static string $resource = StatistikoEventsResource::class;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoEvents\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoEvents\StatistikoEventsResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditStatistikoEvents extends EditRecord
|
||||
{
|
||||
protected static string $resource = StatistikoEventsResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
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
|
||||
{
|
||||
protected static string $resource = StatistikoEventsResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ExportAction::make('download_all')
|
||||
->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')
|
||||
->icon('phosphor-magnifying-glass')
|
||||
->modalSubmitAction(fn(Action $action) => $action->label('Delete all')
|
||||
->color('danger')
|
||||
->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();
|
||||
foreach ($events as $value) {
|
||||
StatistikoEvent::where('match_id', $value->match_id)->delete();
|
||||
}
|
||||
}),
|
||||
Action::make('truncate')
|
||||
->icon('phosphor-trash')
|
||||
->requiresConfirmation()
|
||||
->color('danger')
|
||||
->action(function () {
|
||||
StatistikoEvent::truncate();
|
||||
}),
|
||||
CreateAction::make()
|
||||
->label('New')
|
||||
->icon('phosphor-plus'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user