© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
N1XN

Steps in CreateAction sets only last steps formData

When submitting the form and inspecting the
before()
before()
methods
$data
$data
only the data from the last step is set, resulting in failed inserts as the data from first step is required. Am I using a relation manager, but this should not be any issue I guess.

In the below example
$data['milk']
$data['milk']
does not exist in
before()
before()


use Filament\Forms\Components\Wizard\Step;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables\Actions\CreateAction;

class FoodRelationManager extends RelationManager
{
    protected static string $relationship = ‘foods’;

    protected static ?string $recordTitleAttribute = 'id';

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
        //
            ])
            ->filters([
                //
            ])
            ->headerActions([
                CreateAction::make('create')
                    ->steps([
                        Step::make(‘First’)
                            ->columns(2)
                            ->schema([
                                TextInput::make(‘milk’)
                                    ->numeric()
                                    ->required(),
                            ]),
                        Step::make(‘Second’)
                            ->schema([
                               TextInput::make(‘bread’)
                    ->required(),
                            ]),
                    ])
                    ->before(function ($data) {
              return $data;
                    })
            ])
            ->actions([
        //
            ]);
    }
}
use Filament\Forms\Components\Wizard\Step;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables\Actions\CreateAction;

class FoodRelationManager extends RelationManager
{
    protected static string $relationship = ‘foods’;

    protected static ?string $recordTitleAttribute = 'id';

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
        //
            ])
            ->filters([
                //
            ])
            ->headerActions([
                CreateAction::make('create')
                    ->steps([
                        Step::make(‘First’)
                            ->columns(2)
                            ->schema([
                                TextInput::make(‘milk’)
                                    ->numeric()
                                    ->required(),
                            ]),
                        Step::make(‘Second’)
                            ->schema([
                               TextInput::make(‘bread’)
                    ->required(),
                            ]),
                    ])
                    ->before(function ($data) {
              return $data;
                    })
            ])
            ->actions([
        //
            ]);
    }
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

CreateAction steps nextAction label
FilamentFFilament / ❓┊help
14mo ago
Fill form in CreateAction
FilamentFFilament / ❓┊help
7mo ago
CreateAction::make()
FilamentFFilament / ❓┊help
3y ago