F
Filament4mo ago
Cushty

wizard step sharing from model

Hi I am trying to share the wizard steps from my Model, but it's causing the layout to not be full width and the has skippable steps stops working, Can you shed some light on how to properly setup the wizard to share steps? Thanks
public function form(Form $form): Form
{
return $form->schema([
Wizard::make(Application::formWizard())
]);

}


public function hasSkippableSteps(): bool
{
return true;
}
public function form(Form $form): Form
{
return $form->schema([
Wizard::make(Application::formWizard())
]);

}


public function hasSkippableSteps(): bool
{
return true;
}
public static function formWizard(): array
{
return [
Step::make('Personal Information')
->description('Provide personal details')
->schema([
Select::make('user_id')
->label('User')
->options(User::all()->pluck('name', 'id'))
->required(),
TextInput::make('first_name')
->required(),
TextInput::make('last_name')
->required(),
TextInput::make('public_profile_name')
->required(),
public static function formWizard(): array
{
return [
Step::make('Personal Information')
->description('Provide personal details')
->schema([
Select::make('user_id')
->label('User')
->options(User::all()->pluck('name', 'id'))
->required(),
TextInput::make('first_name')
->required(),
TextInput::make('last_name')
->required(),
TextInput::make('public_profile_name')
->required(),
2 Replies
toeknee
toeknee3mo ago
In the form schema ensure columns passed as 1 or set the wizard::make()->columnSpanFull()
Cushty
CushtyOP3mo ago
the code I added is not working as if i used this instead
protected function getSteps(): array
{
return Application::formWizard();

}
protected function getSteps(): array
{
return Application::formWizard();

}
the skippable steps and the form is full width and working correctly, it seems replacing with this breaks the skippable steps and the layout:
public function form(Form $form): Form
{
return $form->schema([
Wizard::make(Application::formWizard())
]);

}
public function form(Form $form): Form
{
return $form->schema([
Wizard::make(Application::formWizard())
]);

}
The issue is i want the same form in a livewire component and the docs say i need to use a from component. thanks
Want results from more Discord servers?
Add your server