Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lara286950's avatar

Spatie livewire wizard

Kindly provide guidance on the below:

I am receiving this error: Undefined variable $stepInstances. I have not yet migrated to latest version of livewire so I am still using package V1 of https://spatie.be/docs/laravel-livewire-wizard/v1/introduction

Please see code below:

RedeemWizard

<?php

namespace App\Http\Livewire\Redeem;

use App\Http\Livewire\Redeem\Steps\VoucherCodeStepComponent;
use App\Support\State\RedeemWizardState;
use Spatie\LivewireWizard\Components\WizardComponent;

class RedeemWizard extends WizardComponent
{
    public function stateClass(): string
    {
        return RedeemWizardState::class;
    }

    public function steps(): array
    {
        return [
            VoucherCodeStepComponent::class,
//            VehicleRegistrationStepComponent::class,
        ];
    }
}

VoucherCodeStepComponent

<?php

namespace App\Http\Livewire\Redeem\Steps;

use Spatie\LivewireWizard\Components\StepComponent;

class VoucherCodeStepComponent extends StepComponent
{
    public string $voucher;

    public array $rules = [
        'voucher-code'=> 'required',
    ];

    public function stepInfo(): array
    {
        return [
            'label' => 'Redeem voucher'
        ];
    }

    public function submit()
    {
        $this->validate();

        $this->nextStep();
    }

    public function render()
    {
        return view('livewire.redeem.steps.voucher-code-step-component');
    }
}

I have registered the components in app provider:

public function boot()
    {
        Livewire::component('redeem-wizard', RedeemWizard::class);
        Livewire::component('voucher-code-step', VoucherCodeStepComponent::class);
        Livewire::component('vehicle-registration-step', VehicleRegistrationStepComponent::class);
    }

and calling it in view like so:

<livewire:redeem-wizard show-step="voucher-code-step" />

am I missing the plot somewhere?

0 likes
1 reply
Vendrix's avatar
Vendrix
Best Answer
Level 4

Deleting the views\vendor\livewire-wizard components solved the problem for me, but I didn't utilize them.

1 like

Please or to participate in this conversation.