schema([ TextInput::make('title') ->label(__('pages.title_field')) ->required() ->maxLength(255) ->live(onBlur: true) ->afterStateUpdated(function (string $operation, $state, callable $set) { if ($operation !== 'create') { return; } $set('slug', \Str::slug($state)); }), TextInput::make('slug') ->label(__('pages.slug_field')) ->required() ->maxLength(255) ->unique(ignoreRecord: true) ->rules(['alpha_dash']) ->helperText(__('pages.slug_helper_text')), RichEditor::make('content') ->label(__('pages.content_field')) ->fileAttachmentsDisk('public') ->fileAttachmentsDirectory('pages') ->fileAttachmentsVisibility('public') ->columnSpanFull(), Textarea::make('excerpt') ->label(__('pages.excerpt_field')) ->rows(3) ->maxLength(500) ->helperText(__('pages.excerpt_helper_text')) ->columnSpanFull(), ]) ->columnSpan(2) ->collapsible(false); } }