- What is Livewire Wizard and what problem does it solve?
- Livewire Wizard is a Laravel Livewire package for building multi-step forms and wizard interfaces. It lets you define ordered steps, validate each step, move forward and back, and keep form state across steps inside familiar Livewire components. It is useful when a long form needs to be split into manageable sections without losing user input.
- How do I install Livewire Wizard in a Laravel app?
- Install it with Composer by running composer require loubal70/livewire-wizard in your Laravel project. Laravel package discovery should register the package service provider in typical setups. Check the repository README for any extra publish, config, or asset steps.
- Does Livewire Wizard work with Laravel Livewire 3?
- Livewire Wizard is designed around Livewire components, so it fits Livewire-based Laravel applications. Because major Livewire releases can change component APIs, confirm the supported Livewire and Laravel version ranges in the repository README and composer.json before adopting or upgrading. That check is especially important if you are moving an existing app to a new Livewire major version.
- How do I define steps in a Livewire Wizard component?
- You define ordered steps in your Livewire wizard component, typically as an array or method that returns the step sequence. The package then handles navigation through those steps while your component continues to hold the form state. Use the README examples as the source of truth for the exact API in your installed version.
- Can I validate each step before moving to the next?
- Yes. The package is intended for validating each step before allowing forward navigation, so invalid data does not carry into later steps. You define step-level validation rules in your Livewire component, and wizard navigation respects the current step. This keeps each section of a multi-step form clean before the user continues.
- How does Livewire Wizard maintain state across steps?
- State is maintained within the Livewire component as users move between steps. Values entered in earlier steps remain available when the user goes forward or back, without requiring a full page reload. That makes the wizard behave like a normal Livewire form rather than a set of disconnected pages.
- Can users navigate back to previous steps without losing data?
- Yes, backward navigation is a core part of the wizard flow. Because the form state lives in the Livewire component, returning to a previous step should preserve previously entered values. You should still test your own step transitions and validation rules to confirm the behavior matches your form requirements.
- Is Livewire Wizard suitable for production multi-step forms?
- It can be suitable for production multi-step forms when you validate each step and test the full navigation path. As with any Composer package, review its maintenance activity, issue history, and compatibility with your Laravel and Livewire versions before relying on it. Also confirm that its state handling fits your form size and data sensitivity requirements.
- How do I test a Livewire Wizard component?
- Test it like other Livewire components using Laravel's testing tools and Livewire's component test helpers. Cover step transitions, validation failures, and state persistence across forward and back navigation. Those tests help catch regressions when you change validation rules or upgrade Laravel and Livewire.
- Are there alternatives to Livewire Wizard for multi-step forms in Laravel?
- Alternatives include building multi-step forms directly with Livewire components, using other Livewire wizard packages, or using front-end wizard libraries backed by Laravel APIs. Livewire Wizard is a good fit when you want step state and validation to stay inside familiar Livewire components. Compare package maintenance, supported versions, and API fit before choosing.