71 lines
1.9 KiB
PHP
71 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Gutachters;
|
|
|
|
use App\Filament\Resources\Gutachters\Pages\CreateGutachter;
|
|
use App\Filament\Resources\Gutachters\Pages\EditGutachter;
|
|
use App\Filament\Resources\Gutachters\Pages\ListGutachters;
|
|
use App\Filament\Resources\Gutachters\Schemas\GutachterForm;
|
|
use App\Filament\Resources\Gutachters\Tables\GutachtersTable;
|
|
use App\Models\Gutachter;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
class GutachterResource extends Resource
|
|
{
|
|
protected static ?string $model = Gutachter::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'lucide-drafting-compass';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
protected static ?string $navigationLabel = 'Gutachter';
|
|
|
|
protected static ?string $modelLabel = 'Gutachter';
|
|
|
|
protected static ?string $pluralModelLabel = 'Gutachter';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return GutachterForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return GutachtersTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListGutachters::route('/'),
|
|
'create' => CreateGutachter::route('/create'),
|
|
'edit' => EditGutachter::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function getRecordRouteBindingEloquentQuery(): Builder
|
|
{
|
|
return parent::getRecordRouteBindingEloquentQuery()
|
|
->withoutGlobalScopes([
|
|
SoftDeletingScope::class,
|
|
]);
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return parent::getEloquentQuery()->count();
|
|
}
|
|
}
|