components([ Section::make('Positionen')->description('Was angeboten wird, mit welchem Rechteprofil.')->schema([ TextEntry::make('positions')->hiddenLabel()->listWithLineBreaks() ->state(fn (Offer $record): array => app(CatalogReading::class)->offerPositions($record)), ]), Section::make('Aufgelöste Berechtigungen')->description('Diese Artikel-Rechte entstehen beim Erwerb.')->schema([ TextEntry::make('grants')->hiddenLabel()->listWithLineBreaks() ->state(fn (Offer $record): array => app(CatalogReading::class)->offerGrants($record)), ]), ]); } 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(), ]); } public static function getPages(): array { return [ 'index' => ListOffers::route('/'), 'view' => ViewOffer::route('/{record}'), ]; } }