Commit 390d55df authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix trainer wizard crash on step 6 — skip validate() when rules are empty

Livewire's validate([]) falls back to looking for a $rules property on
the component. Steps 6 and 7 intentionally have no validation rules, so
only call validate() when the rules array is non-empty.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent aec2c2be
......@@ -346,10 +346,11 @@ public function messagesForStep(int $step): array
public function nextStep(): void
{
$this->validate(
$this->rulesForStep($this->currentStep),
$this->messagesForStep($this->currentStep)
);
$rules = $this->rulesForStep($this->currentStep);
if (!empty($rules)) {
$this->validate($rules, $this->messagesForStep($this->currentStep));
}
if ($this->currentStep < $this->totalSteps) {
$this->currentStep++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment