wip mango
This commit is contained in:
1 parent
df60d37f3a
commit
ad7925bbba
19 files changed
+19040
-138
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\UbEventResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateUbEvent extends CreateRecord
|
||||
{
|
||||
protected static string $resource = UbEventResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\UbEventResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditUbEvent extends EditRecord
|
||||
{
|
||||
protected static string $resource = UbEventResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\UbEventResource;
|
||||
use App\Filament\Imports\UbEventImporter;
|
||||
use Filament\Actions\ImportAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListUbEvents extends ListRecords
|
||||
{
|
||||
protected static string $resource = UbEventResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ImportAction::make('importPlayer')
|
||||
->icon('phosphor-upload')
|
||||
->label('Events')
|
||||
->modalDescription('Separator comma ";"')
|
||||
->importer(UbEventImporter::class),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class UbEventForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class UbEventsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
// TextColumn::make('league_id')->searchable(),
|
||||
TextColumn::make('league.name')->searchable(),
|
||||
// TextColumn::make('home_id')->searchable(),
|
||||
// TextColumn::make('away_id')->searchable(),
|
||||
TextColumn::make('home.name')->searchable(),
|
||||
TextColumn::make('away.name')->searchable(),
|
||||
TextColumn::make('player.name')->searchable(),
|
||||
TextColumn::make('starttime')->dateTime('d. M. Y')->label('Date'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\UbEvents;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\Pages\ListUbEvents;
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\Schemas\UbEventForm;
|
||||
use App\Filament\Clusters\StaticData\Resources\UbEvents\Tables\UbEventsTable;
|
||||
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||
use App\Models\UbEvent;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class UbEventResource extends Resource
|
||||
{
|
||||
protected static ?string $model = UbEvent::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'icon-soccerball';
|
||||
|
||||
protected static ?string $navigationLabel = 'Events';
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'league_id';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return UbEventForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return UbEventsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListUbEvents::route('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user