52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Offers;
|
|
|
|
use App\Domain\Catalog\Offer;
|
|
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
|
|
use App\Filament\Resources\Offers\Pages\ListOffers;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class OfferResource extends Resource
|
|
{
|
|
protected static ?string $model = Offer::class;
|
|
|
|
protected static string|\UnitEnum|null $navigationGroup = 'Katalog';
|
|
|
|
protected static ?string $navigationLabel = 'Angebote';
|
|
|
|
protected static ?string $modelLabel = 'Angebot';
|
|
|
|
protected static ?string $pluralModelLabel = 'Angebote';
|
|
|
|
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.status')->label('Fassungen')->badge(),
|
|
])->recordUrl(null);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListOffers::route('/'),
|
|
];
|
|
}
|
|
}
|