wdelfuego / nova-wizard

A simple multi-step Wizard tool for Laravel Nova 4
Other
11 stars 5 forks source link

Feature: allow passing forwards of query params to nova wizard #7

Closed olliescase closed 8 months ago

olliescase commented 8 months ago

This allows for you to have an action that redirects to the nova wizard with URL parameters set. Useful for pre-filling fields.

Eg. CreateItem action that:

return $this->redirect('/' . NovaWizard::pathToWizard('my-wizard') . "?parentId={$resource->id}");

Then in the Wizard definition you can do:

$this->request->get('parentId')

wdelfuego commented 8 months ago

Hey, that's great! Will merge and test soon.

wdelfuego commented 8 months ago

Now available in version 1.1 of this package :).

I've added a small explanation to the readme and added the query params to the submit route so that any query params are available when the form data is being processed, too.

Thanks a lot for your contribution, @olliescase ! 🙏