Steps in CreateAction sets only last steps formData
When submitting the form and inspecting the
In the below example
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([
//
]);
}
}