columns(3) ->components([ Section::make('Content') ->columnSpan(2) ->components([ TextInput::make('title') ->required() ->live(onBlur: true) ->afterStateUpdated(function (string $operation, $state, callable $set) { if ($operation === 'create') { $set('slug', Str::slug($state)); } }), TextInput::make('slug') ->required() ->unique(Page::class, 'slug', ignoreRecord: true) ->helperText('Used in the URL, e.g. /your-slug'), MarkdownEditor::make('body') ->required() ->columnSpanFull(), ]), Section::make('Visibility') ->columnSpan(1) ->components([ Toggle::make('published') ->default(true), Toggle::make('show_in_footer') ->label('Show in footer') ->default(true), TextInput::make('order') ->numeric() ->default(0) ->helperText('Lower numbers appear first in the footer.'), ]), Section::make('SEO') ->description('Optional overrides for search engines and social sharing.') ->columnSpan(3) ->columns(2) ->collapsible() ->components([ TextInput::make('meta_title') ->maxLength(60) ->helperText('Falls back to the page title if left blank.'), TextInput::make('meta_description') ->maxLength(160), ]), ]); } }