Replies: 2 comments 3 replies
-
What I have come up with so far is:
Then in each step I can do |
Beta Was this translation helpful? Give feedback.
0 replies
-
This should do it: https://spatie.be/docs/laravel-livewire-wizard/v2/usage/setting-initial-state. public function initialState(): array
{
$user = User::findOrFail($this->userId);
return [
'delivery-address-step' => [
'zip' => $user->zip,
'city' => $user->city,
],
];
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I have a need to skip / remove some steps in a wizard, and I would like to store some default values for the information that would normally be retrieved in the step(s) that is removed.
The way that I handle which steps that I will show / hide is like this:
then in the mount() method I fill the
$this->customSteps
, that seems to be working.I cannot figure how I can set values on my state class in the mount() method of the wizard component and then use the information in one or more steps.
If I understand the code correctly, a State object is only created when on try to access the
$this->state()
in a step, or is that wrong ?So, if the above is correct doe that mean that you cannot access the state object in the mount method of the WizardComponent?
Beta Was this translation helpful? Give feedback.
All reactions