user(); return $user instanceof User && $user->hasStaffRole(StaffRole::Redakteur); } public static function getViewAuthorizationResponse(Model $record): Response { return self::editor() ? Response::allow() : Response::deny(); } public static function infolist(Schema $schema): Schema { return $schema->components([ Section::make('Fassungen')->schema([ TextEntry::make('versions')->hiddenLabel()->listWithLineBreaks() ->state(fn (ContentElement $record): array => app(CatalogReading::class)->elementVersions($record)), ]), Section::make('Verwendung')->description('Kompositionen und Lizenzartikel, die auf dieses Material zeigen.')->schema([ TextEntry::make('usage')->hiddenLabel()->listWithLineBreaks() ->state(fn (ContentElement $record): array => app(CatalogReading::class)->elementUsage($record)), ]), ]); } public static function form(Schema $schema): Schema { return $schema; } public static function table(Table $table): Table { return $table->columns([ TextColumn::make('working_title')->label('Arbeitstitel')->searchable(), TextColumn::make('kind')->label('Art'), TextColumn::make('output_class')->label('Ausgabeklasse'), TextColumn::make('versions_count')->counts('versions')->label('Fassungen'), ]); } public static function getPages(): array { return [ 'index' => ListContentElements::route('/'), 'view' => ViewContentElement::route('/{record}'), ]; } }