61 lines
1.7 KiB
PHP
61 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Clusters\Verwaltung\Gutachters;
|
|
|
|
use App\Filament\Clusters\Verwaltung\Gutachters\Pages\ListGutachters;
|
|
use App\Filament\Clusters\Verwaltung\Gutachters\Schemas\GutachterForm;
|
|
use App\Filament\Clusters\Verwaltung\Gutachters\Tables\GutachtersTable;
|
|
use App\Filament\Clusters\Verwaltung\VerwaltungCluster;
|
|
use App\Models\Gutachter;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class GutachterResource extends Resource
|
|
{
|
|
protected static ?string $model = Gutachter::class;
|
|
|
|
protected static ?int $navigationSort = 2;
|
|
|
|
protected static ?string $cluster = VerwaltungCluster::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'lucide-stamp';
|
|
|
|
protected static ?string $recordTitleAttribute = 'company';
|
|
|
|
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 getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListGutachters::route('/'),
|
|
];
|
|
}
|
|
|
|
public static function getEloquentQuery(): Builder
|
|
{
|
|
return parent::getEloquentQuery()->where('konto_id', auth()->user()->konto_id);
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return parent::getEloquentQuery()->where('konto_id', auth()->user()->konto_id)->count();
|
|
}
|
|
}
|