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
Mohamed Ayaou
Mohamed Ayaou2w ago
By default it will redirect you to the ViewResource page, isn't that what you need?
Hemanath
HemanathOP5d ago
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
josef
josef5d ago
maybe using the filament peek plugin?
Mohamed Ayaou
Mohamed Ayaou5d ago
Use the ->afterValidation() on steps to run any custom code like showing a popup after the step
Hemanath
HemanathOP4d ago
Okay, then I will try. Thank you.
Want results from more Discord servers?
Add your server