How to combine Wizard and Builder form component

       return $form
            ->schema([
                Wizard::make([
                    Wizard\Step::make('Select Items')
                        ->schema([
                            Builder::make('content')
                            ->blocks([
                                Builder\Block::make('Add items')
                                    ->schema([
                                        Forms\Components\Select::make('item_id')
                                        ->relationship('item', 'item_name')
                                        ->required(),
                                        Forms\Components\TextInput::make('quantity')
                                        ->required()
                                        ->numeric(),
                                    Forms\Components\DatePicker::make('transfer_date')
                                        ->required(),
                                    Forms\Components\TextInput::make('notes')
                                        ->required()
                                        ->maxLength(255),
                                    ])
                        ])

                        ]),
                    Wizard\Step::make('Select Branch')
                        ->schema([
                            Forms\Components\Select::make('branch_id')
                            ->relationship('branch', 'branch_name')
                                ->required(),
                        ]),
                    ])->submitAction(new HtmlString(Blade::render(<<<BLADE
                    <x-filament::button
                        type="submit"
                        size="sm"
                    >
                        Submit
                    </x-filament::button>
                BLADE)))

            ]);
    }
Was this page helpful?