|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Moox\Bpmn\Resources\Bpmns; |
| 4 | + |
| 5 | +use BackedEnum; |
| 6 | +use Filament\Tables\Table; |
| 7 | +use Moox\Bpmn\Models\Bpmn; |
| 8 | +use Filament\Schemas\Schema; |
| 9 | +use Filament\Resources\Resource; |
| 10 | +use Filament\Support\Icons\Heroicon; |
| 11 | +use Moox\Bpmn\Resources\Bpmns\Pages\EditBpmn; |
| 12 | +use Moox\Bpmn\Resources\Bpmns\Pages\ViewBpmn; |
| 13 | +use Moox\Bpmn\Resources\Bpmns\Pages\ListBpmns; |
| 14 | +use Moox\Bpmn\Resources\Bpmns\Pages\CreateBpmn; |
| 15 | +use Moox\Bpmn\Resources\Bpmns\Schemas\BpmnForm; |
| 16 | +use Moox\Bpmn\Resources\Bpmns\Tables\BpmnsTable; |
| 17 | +use Moox\Bpmn\Resources\Bpmns\Schemas\BpmnInfolist; |
| 18 | + |
| 19 | +class BpmnResource extends Resource |
| 20 | +{ |
| 21 | + protected static ?string $model = Bpmn::class; |
| 22 | + |
| 23 | + protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack; |
| 24 | + |
| 25 | + protected static ?string $recordTitleAttribute = 'Bpmn'; |
| 26 | + |
| 27 | + public static function form(Schema $schema): Schema |
| 28 | + { |
| 29 | + return BpmnForm::configure($schema); |
| 30 | + } |
| 31 | + |
| 32 | + public static function infolist(Schema $schema): Schema |
| 33 | + { |
| 34 | + return BpmnInfolist::configure($schema); |
| 35 | + } |
| 36 | + |
| 37 | + public static function table(Table $table): Table |
| 38 | + { |
| 39 | + return BpmnsTable::configure($table); |
| 40 | + } |
| 41 | + |
| 42 | + public static function getRelations(): array |
| 43 | + { |
| 44 | + return [ |
| 45 | + // |
| 46 | + ]; |
| 47 | + } |
| 48 | + |
| 49 | + public static function getPages(): array |
| 50 | + { |
| 51 | + return [ |
| 52 | + 'index' => ListBpmns::route('/'), |
| 53 | + 'create' => CreateBpmn::route('/create'), |
| 54 | + 'view' => ViewBpmn::route('/{record}'), |
| 55 | + 'edit' => EditBpmn::route('/{record}/edit'), |
| 56 | + ]; |
| 57 | + } |
| 58 | +} |
0 commit comments