F
Filament2mo ago
gg

What can I use instead of Placeholder in version 4?

'Filament\Forms\Components\Placeholder' is deprecated in version 4. My current code
Forms\Components\Placeholder::make('name') ->label('Name') ->content(fn ($get) => $get('name')),
7 Replies
awcodes
awcodes2mo ago
TextEntry with ->state()
gg
ggOP2mo ago
thanks.That work fine for text input fields. But I also have a question how can I embedded html from rich editor? for example -> description is from rich editor and that code not working.
TextEntry::make('review_description') ->label('Description') ->state(fn ($get) => $get('description')),
@awcodes
LeandroFerreira
LeandroFerreira2mo ago
?
RichEditor::make('description')
->live(onBlur: true),
TextEntry::make('review_description')
->state(fn (Get $get) => $get('description'))
->html()
RichEditor::make('description')
->live(onBlur: true),
TextEntry::make('review_description')
->state(fn (Get $get) => $get('description'))
->html()
epertinez
epertinez2mo ago
In my case the code was: Placeholder::make('')->columnSpan(1), Used to insert an space between a 2 columns component and a 1 column one. I don't find a way to substitute it. TextEntry::make(' ')->state(' ')->columnSpan(1) Requires make and state to have non empty values. And if I put values on them they show in the form.
gg
ggOP2mo ago
the solution is using TextEntry with state for example -> TextEntry::make('my_entry') ->state(fn(Get $get) => $get('my_entry')),

Did you find this page helpful?