components([ TextInput::make('title') ->label('Título') ->required() ->maxLength(255) ->live(onBlur: true) ->afterStateUpdated(function (?string $state, callable $set, callable $get): void { if (blank($get('slug'))) { $set('slug', str($state)->slug()->toString()); } }), TextInput::make('slug') ->label('Slug') ->required() ->maxLength(255) ->unique(ignoreRecord: true), TextInput::make('summary') ->label('Resumo') ->required() ->maxLength(255), TextInput::make('event_type') ->label('Tipo de evento') ->required() ->maxLength(255), TextInput::make('city') ->label('Cidade') ->maxLength(255), TextInput::make('venue') ->label('Local') ->maxLength(255), DatePicker::make('event_date') ->label('Data do evento'), Textarea::make('challenge') ->label('Desafio') ->required() ->rows(4), Textarea::make('solution') ->label('Solução') ->required() ->rows(4), Textarea::make('result') ->label('Resultado') ->rows(4), PublicImageUploadRules::fileUpload('cover_image_path', 'Imagem de capa'), PublicImageUploadRules::altTextField('cover_image_alt', 'cover_image_path'), TextInput::make('sort_order') ->label('Ordem') ->numeric() ->default(0) ->required(), Toggle::make('is_featured') ->label('Destaque') ->default(false), DateTimePicker::make('published_at') ->label('Publicado em') ->seconds(false), TextInput::make('meta_title') ->label('Meta title') ->maxLength(255), Textarea::make('meta_description') ->label('Meta description') ->rows(3), ]); } }