wip
This commit is contained in:
1 parent
d62d5c5e8e
commit
1723221b88
16 files changed
+980
-16502
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Events\Tables;
|
||||
|
||||
use App\Filament\Tables\Columns\MultilineClient;
|
||||
use App\Models\Event;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
@@ -10,6 +11,8 @@ use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class EventsTable
|
||||
@@ -17,7 +20,6 @@ class EventsTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->poll('10s')
|
||||
->striped()
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
@@ -26,7 +28,7 @@ class EventsTable
|
||||
->size(IconSize::ExtraLarge)
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->tooltip(fn ($record) => $record->id),
|
||||
TextColumn::make('txodds_id')->label('Id')->badge()->copyable()->searchable(),
|
||||
TextColumn::make('tx_id')->label('Id')->badge()->copyable()->searchable(),
|
||||
TextColumn::make('starttime')
|
||||
->label('Start')
|
||||
->alignCenter()
|
||||
@@ -46,27 +48,31 @@ class EventsTable
|
||||
->label(fn () => view('filament.tables.columns.multiline-labels')),
|
||||
|
||||
])
|
||||
->poll('10s')
|
||||
->defaultSort('starttime', 'ASC')
|
||||
// ->filters([
|
||||
// SelectFilter::make('competition_group_id')
|
||||
// ->preload()
|
||||
// ->label('League')
|
||||
// ->multiple()
|
||||
// ->searchable()
|
||||
// ->options(function () {
|
||||
->filters([
|
||||
SelectFilter::make('competition_group_id')
|
||||
->preload()
|
||||
->label('League')
|
||||
->multiple()
|
||||
->searchable()
|
||||
->options(function () {
|
||||
|
||||
// $res = Event::with('country')->with('competition_group')->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
|
||||
// $arr = [];
|
||||
// foreach ($res as $val) {
|
||||
// $arr[$val->competition_group_id] = $val->country->name.' - '.$val->competition_group->name;
|
||||
// }
|
||||
$res = Event::with('country')->with('competition_group')->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
|
||||
$arr = [];
|
||||
foreach ($res as $val) {
|
||||
$arr[$val->competition_group_id] = $val->country->name.' - '.$val->competition_group->name;
|
||||
}
|
||||
|
||||
// asort($arr);
|
||||
asort($arr);
|
||||
|
||||
// return $arr;
|
||||
// })
|
||||
// ->selectablePlaceholder(false),
|
||||
// ], layout: FiltersLayout::AboveContent)
|
||||
return $arr;
|
||||
})
|
||||
->columnSpan(2 )
|
||||
->selectablePlaceholder(false),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->filtersFormColumns(6)
|
||||
->deferFilters(false)
|
||||
->persistFiltersInSession()
|
||||
->recordActions([
|
||||
// EditAction::make(),
|
||||
|
||||
Reference in new issue
Block a user