components([ Flex::make([ Section::make([ Textarea::make('name') ->required() ->label('Kapitel Überschrift'), Checkbox::make('ueberschrift_nicht_anzeigen') ->label('Überschrift nicht angezeigen'), ]), Section::make([ TextInput::make('ordnungszahl') ->label('Kapitel Index') ->placeholder('3.21') ->numeric() ->default(0) ->belowContent([ 'Bei "0" wird der Index im PDF nicht angezeigt', ]), TextInput::make('seite') ->label('Seitenzahl') ->numeric() ->default(0) ->belowContent([ 'Bei "0" wird die Seitenzahl automatisch generiert', ]), ]), ])->columnSpanFull(2), Select::make('tabellen_id')->label('Tabelle') ->prefixIcon('phosphor-table') ->default(0) ->options(function () { return Tabellen::all()->pluck('name', 'id')->toArray(); })->belowContent([ 'Kann auch frei bleiben', ]), Select::make('textblock_id')->label('Textblock') ->prefixIcon('phosphor-article') ->default(0) ->options(function () { return Textblock::all()->pluck('name', 'id')->toArray(); // return ['100' => 'Eigener Textblock'] + $relatedOptions; })->belowContent([ 'Kann auch frei bleiben', ]), ]); } }