Preview step after entered the data
use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Wizard\Step;
protected function getSteps(): array
{
return [
Step::make('Name')
->description('Give the category a clear and unique name')
->schema([
TextInput::make('name')
->required()
->live()
->afterStateUpdated(fn ($state, callable $set) => $set('slug', Str::slug($state))),
TextInput::make('slug')
->disabled()
->required()
->unique(Category::class, 'slug', fn ($record) => $record),
]),
Step::make('Description')
->description('Add some extra details')
->schema([
MarkdownEditor::make('description')
->columnSpan('full'),
]),
Step::make('Visibility')
->description('Control who can view it')
->schema([
Toggle::make('is_visible')
->label('Visible to customers.')
->default(true),
]),
];
},I want to preview the data after entered the form any solution in filament for thsi method in create
5 Replies
By default it will redirect you to the ViewResource page, isn't that what you need?
No, when we create, we have to show a modal popup wanting to preview or submit the data. If previewing the entire step you want to view, if submitting the data, we need to store it. Is there any way
maybe using the filament peek plugin?
Use the
->afterValidation()
on steps to run any custom code like showing a popup after the stepOkay, then I will try. Thank you.