52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\RightsProfiles;
|
|
|
|
use App\Domain\Catalog\RightsProfile;
|
|
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
|
|
use App\Filament\Resources\RightsProfiles\Pages\ListRightsProfiles;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class RightsProfileResource extends Resource
|
|
{
|
|
protected static ?string $model = RightsProfile::class;
|
|
|
|
protected static string|\UnitEnum|null $navigationGroup = 'Katalog';
|
|
|
|
protected static ?string $navigationLabel = 'Rechteprofile';
|
|
|
|
protected static ?string $modelLabel = 'Rechteprofil';
|
|
|
|
protected static ?string $pluralModelLabel = 'Rechteprofile';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
public static function canViewAny(): bool
|
|
{
|
|
return LicenseArticleResource::keeper();
|
|
}
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return $schema;
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table->columns([
|
|
TextColumn::make('name')->label('Name')->searchable(),
|
|
TextColumn::make('versions.purpose')->label('Zwecke')->badge(),
|
|
])->recordUrl(null);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListRightsProfiles::route('/'),
|
|
];
|
|
}
|
|
}
|