Upgrading
From 1.x to 2.0
2.0 rebuilds the package the way Laravel itself is built:
- wizards and steps are classes;
- step input is validated by form requests with their whole lifecycle;
- state is kept per visitor in configurable stores;
- routes are opt-in.
Sessions written by 1.x keep working, so visitors in the middle of a wizard keep their progress through the deploy.
The complete guide maps every 1.x class, method, config key and event to its replacement: UPGRADING.md.
The short version:
composer require "invelity/laravel-headless-wizard:^2.0". This needs PHP 8.4+ and Laravel 12 or 13.- Republish
config/wizard.php;storage.driverbecamedefault. - Turn each wizard into a class that extends
Invelity\WizardPackage\Wizardand lists its$steps. Keep the 1.x id in$name(for exampleorder-wizard) so the session key stays the same. - Turn each step’s constructor arguments into properties,
getFormRequest()into$formRequest, andprocess()into an optionalhandle(). - Replace
initialize()+processStep()with an injected wizard andprocess(); raw state writes becomeputMetadata(),goTo()andreopen(). - Register routes with
Route::wizard()if you used the package routes, and useEnsureStepIsAccessiblewith your own routes.