jeffersongoncalves/laravel-livewire-wizard

A maintained fork of spatie/laravel-livewire-wizard v2, kept compatible with Livewire 3 and Laravel 11/12/13. Build multi-step wizards where each step is its own Livewire component, state flows between steps automatically, and navigation is a method call away.
composer require jeffersongoncalves/laravel-livewire-wizard
namespace App\Livewire;
use JeffersonGoncalves\LivewireWizard\Components\WizardComponent;
class CheckoutWizardComponent extends WizardComponent
{
public function steps(): array
{
return [
CartStepComponent::class,
DeliveryAddressStepComponent::class,
ConfirmOrderStepComponent::class,
];
}
}
Each step is a regular Livewire component that extends StepComponent:
namespace App\Livewire;
use JeffersonGoncalves\LivewireWizard\Components\StepComponent;
class CartStepComponent extends StepComponent
{
public function render()
{
return view('checkout-wizard.steps.cart');
}
}
use Livewire\Livewire;
Livewire::component('checkout-wizard', CheckoutWizardComponent::class);
Livewire::component('cart-step', CartStepComponent::class);
Livewire::component('delivery-address-step', DeliveryAddressStepComponent::class);
Livewire::component('confirm-order-step', ConfirmOrderStepComponent::class);
<livewire:checkout-wizard />
From inside any step component:
$this->nextStep();
$this->previousStep();
Or directly in a view:
<div wire:click="previousStep">Back</div>
<div wire:click="nextStep">Next</div>
State set via public properties on one step is automatically available on the next. See the original Spatie docs for the full guide on initial state, custom state objects, and testing wizards — the v2/Livewire 3 API this package tracks is unchanged.
composer test
Please see CHANGELOG for more information on what has changed recently.
Contributions are welcome! Please feel free to submit a Pull Request.
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?