components([ Section::make('Überschrift') ->schema([ Checkbox::make('neue_seite') ->label('Start neuer Seite'), Checkbox::make('ueberschrift_anzeigen') ->label('Überschrift angezeigen'), Textarea::make('name') ->required() ->label('Überschrift in der Inhaltsangabe') ->columnSpan(2), Textarea::make('name2') ->label('Überschrift im Dokument') ->belowContent([ 'Bei abweichender Überschrift im Dokument', ]) ->columnSpan(2), TextInput::make('ordnungszahl') ->label('Kapitel Index') ->placeholder('3.21') ->numeric() ->default(0) ->belowContent([ 'Bei "0" wird der Index im PDF nicht angezeigt', ]) ->columnSpan(1), TextInput::make('seite') ->label('Seitenzahl') ->numeric() ->default(0) ->belowContent([ 'Bei "0" wird die Seitenzahl automatisch generiert', ]) ->columnSpan(1), ])->columnSpanFull(), Section::make('Tabellen & Textblöcke') ->hiddenLabel() ->schema([ Select::make('tabellen_id')->label('Tabelle') ->prefixIcon('phosphor-table') ->prefixIconColor( fn ($record): string => $record->tabellen_id == 0 ? 'gray' : 'primary' ) ->default(0) ->options(function () { $res = Tabellen::all()->pluck('name', 'id')->toArray(); array_unshift($res, 'Ohne Tabelle'); return $res; }), Select::make('textblock_id')->label('Textblock') ->prefixIcon('phosphor-article') ->prefixIconColor( fn ($record): string => $record->textblock_id == 0 ? 'gray' : 'primary' ) ->default(0) ->options(function () { $res = Textblock::all()->pluck('name', 'id')->toArray(); array_unshift($res, 'Ohne Textblock'); return $res; }), ])->columnSpanFull(), ]); } }