Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Livewire Wizard Laravel Package

spatie/laravel-livewire-wizard

Lightweight Livewire components for building multi-step wizards in Laravel. Define a wizard with an ordered list of step components, each with its own screen and Livewire logic, and guide users through checkout-style flows with ease.

View on GitHub
Deep Wiki
Context7

title: Rendering navigation weight: 3

Any step component has a $steps property that contains an array containing information on all steps in the wizard. You can use $steps to build any navigation you want. Here's an example:

{{-- somewhere in a Blade view--}}
<ul>
    [@foreach](https://github.com/foreach)($steps as $step)
        <li 
            class="{{ $step->isCurrent() ? 'text-bold' : '' }}"
            [@if](https://github.com/if) ($step->isPrevious())
                wire:click="{{ $step->show() }}"
            [@endif](https://github.com/endif)
        >{{ $step->label }}</li>
    [@endforeach](https://github.com/endforeach)
</ul>

Available methods

Each entry in the array contains an instance of Spatie\LivewireWizard\Support\Step. It has these methods:

  • isCurrent(): returns true if this step is currently being displayed
  • isPrevious(): returns true if this step comes before the step that's currently displayed
  • isNext(): returns true if this step comes after the step that's currently displayed
  • show(): return the string that can be passed to wire:click to show the step

Adding extra info to a step

In the example above, you see that we've used $step->label to render the content of the <li>. That label property isn't available by default.

You can add any property on a step by adding a stepInfo method your Step component. That method should contain an array with properties regarding your step.

// in your step component

public function stepInfo(): array
{
    return [
        'label' => 'Your cart',
        'icon' => 'fa-shopping-cart',  
    ];
}

Any key you return will be available as a property on step.

$step->label; // returns 'Your cart'
$step->icon; // returns 'fa-shopping-cart'
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport