Initial commit

This commit is contained in:
2026-05-20 18:25:15 +02:00
commit 95f0b4ff01
288 changed files with 90909 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Filament\Resources\Platforms\Pages;
use App\Filament\Resources\Platforms\PlatformResource;
use Filament\Resources\Pages\CreateRecord;
class CreatePlatform extends CreateRecord
{
protected static string $resource = PlatformResource::class;
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Filament\Resources\Platforms\Pages;
use App\Filament\Resources\Platforms\PlatformResource;
use Filament\Actions\DeleteAction;
use Filament\Resources\Pages\EditRecord;
class EditPlatform extends EditRecord
{
protected static string $resource = PlatformResource::class;
protected function getHeaderActions(): array
{
return [
DeleteAction::make(),
];
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Filament\Resources\Platforms\Pages;
use App\Filament\Resources\Platforms\PlatformResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
class ListPlatforms extends ListRecords
{
protected static string $resource = PlatformResource::class;
protected function getHeaderActions(): array
{
return [
CreateAction::make(),
];
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Filament\Resources\Platforms;
use App\Filament\Resources\Platforms\Pages\CreatePlatform;
use App\Filament\Resources\Platforms\Pages\EditPlatform;
use App\Filament\Resources\Platforms\Pages\ListPlatforms;
use App\Filament\Resources\Platforms\Schemas\PlatformForm;
use App\Filament\Resources\Platforms\Tables\PlatformsTable;
use App\Models\Platform;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
class PlatformResource extends Resource
{
protected static ?string $model = Platform::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::Cube;
protected static ?string $recordTitleAttribute = 'name';
public static function form(Schema $schema): Schema
{
return PlatformForm::configure($schema);
}
public static function table(Table $table): Table
{
return PlatformsTable::configure($table);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => ListPlatforms::route('/'),
'create' => CreatePlatform::route('/create'),
'edit' => EditPlatform::route('/{record}/edit'),
];
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Filament\Resources\Platforms\Schemas;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;
class PlatformForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('name')
->required()
->maxLength(100),
TextInput::make('slug')
->required()
->unique( ignoreRecord: true )
->maxLength(100),
TextInput::make('short_name')
->default(null)
->maxLength(30),
]);
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Filament\Resources\Platforms\Tables;
use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
class PlatformsTable
{
public static function configure(Table $table): Table
{
return $table
->columns([
TextColumn::make('name')
->searchable()
->sortable(),
TextColumn::make('slug')
->searchable(),
TextColumn::make('short_name')
->searchable(),
TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->recordActions([
EditAction::make(),
])
->toolbarActions([
BulkActionGroup::make([
DeleteBulkAction::make(),
]),
]);
}
}