remove tabulator-tables design event table grid
This commit is contained in:
1 parent
a597d3161b
commit
12b27a52dc
46 files changed
+17584
-437
No files matched your search
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events;
|
||||
|
||||
use App\Filament\Resources\Events\Pages\ListEvents;
|
||||
use App\Filament\Resources\Events\Schemas\EventForm;
|
||||
use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Models\Event;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class EventResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Event::class;
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'phosphor-monitor';
|
||||
|
||||
protected static ?string $navigationLabel = 'Monitor';
|
||||
|
||||
protected static ?string $modelLabel = 'Monitor';
|
||||
|
||||
protected static ?string $title = 'Monitor';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Monitor';
|
||||
|
||||
public static function getPluralModelLabel(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return EventForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return EventsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListEvents::route('/'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Pages;
|
||||
|
||||
use App\Filament\Resources\Events\EventResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateEvent extends CreateRecord
|
||||
{
|
||||
protected static string $resource = EventResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Pages;
|
||||
|
||||
use App\Filament\Resources\Events\EventResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditEvent extends EditRecord
|
||||
{
|
||||
protected static string $resource = EventResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Pages;
|
||||
|
||||
use App\Filament\Resources\Events\EventResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListEvents extends ListRecords
|
||||
{
|
||||
protected static string $resource = EventResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
// CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class EventForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
DateTimePicker::make('starttime'),
|
||||
TextInput::make('sport_id')
|
||||
->required()
|
||||
->numeric(),
|
||||
TextInput::make('country_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('liga_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('home_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('away_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('provider_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('txodds_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('betaid_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('betradar_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('magnig_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('magken_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('lognig_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
TextInput::make('logcol_id')
|
||||
->numeric()
|
||||
->default(0),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Events\Tables;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
->size(IconSize::ExtraLarge)
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->extraAttributes(fn ($record): array => [
|
||||
'x-tooltip.html' => new HtmlString,
|
||||
'x-tooltip.raw' => new HtmlString('Betradar: '.$record->betaid_id.'<br>TxOdds: '.$record->txodds_id),
|
||||
]),
|
||||
TextColumn::make('starttime')
|
||||
->label('Start')
|
||||
->alignCenter()
|
||||
->dateTime('d.m')
|
||||
->weight(FontWeight::Bold)
|
||||
->description(fn ($state): string => Carbon::createFromDate($state)->format('H:i')),
|
||||
TextColumn::make('liga.name')
|
||||
->color('gray')
|
||||
->label('Event')
|
||||
->icon(fn ($record) => $record->country->icon)
|
||||
->description(fn ($record) => $record->home->name.' - '.$record->away->name, position: 'belowe'),
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime('d.m H:i'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
// EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user