components([ TextInput::make('title') ->required() ->live(onBlur: true) ->afterStateUpdated(fn ($state, callable $set) => $set('slug', Str::slug($state))), TextInput::make('slug') ->required() ->unique(ignoreRecord: true), Textarea::make('excerpt') ->columnSpanFull(), RichEditor::make('body') ->columnSpanFull(), FileUpload::make('cover_image') ->image() ->disk('public') ->directory('posts'), TagsInput::make('tags') ->columnSpanFull(), DateTimePicker::make('published_at') ->helperText('Leave blank to keep this post as a draft.'), ]); } }