wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
+88
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoImports\Tables;
|
||||
|
||||
use App\Filament\Imports\StatistikoImporter;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class StatistikoImportsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
SelectColumn::make('data_type')
|
||||
->sortable()
|
||||
->native(false)
|
||||
->allowOptionsHtml()
|
||||
->options([
|
||||
'details' => '<span class="text-blue-500">Player Details</span>',
|
||||
'player' => '<span class="text-pink-600">Player History</span>',
|
||||
'fixtures' => '<span class="text-orange-500">Fixtures Upcoming</span>',
|
||||
'events' => '<span class="text-green-500">Events History</span>',
|
||||
]),
|
||||
TextColumn::make('file_name_original')
|
||||
->sortable()
|
||||
->searchable()
|
||||
->label('Name'),
|
||||
IconColumn::make('has_run')
|
||||
->label('Imported')
|
||||
->sortable()
|
||||
->alignCenter()
|
||||
->boolean()
|
||||
->falseColor('gray'),
|
||||
TextColumn::make('created_at')->dateTime()
|
||||
->sortable(),
|
||||
|
||||
])
|
||||
->defaultSort('id', direction: 'desc')
|
||||
->filters([
|
||||
SelectFilter::make('data_type')
|
||||
->options([
|
||||
'details' => 'Details',
|
||||
'events' => 'Events',
|
||||
'fixtures' => 'Fixtures',
|
||||
'player' => 'Player',
|
||||
]),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->filtersFormColumns(6)
|
||||
->persistFiltersInSession()
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
ActionGroup::make([
|
||||
Action::make('import')
|
||||
->label('Import')
|
||||
->color('success')
|
||||
->tooltip('Update or create')
|
||||
->icon('phosphor-database')
|
||||
->action(fn($record) => StatistikoImporter::run($record))
|
||||
->successNotification(
|
||||
Notification::make()
|
||||
->info()
|
||||
->title('Import started')
|
||||
),
|
||||
DeleteAction::make()
|
||||
->successNotificationTitle('File deleted')
|
||||
->label('Delete file'),
|
||||
]),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make()
|
||||
->successNotificationTitle('Files deleted'),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user