From f68639dd1da38fde2a4ee6beb9c24c3d95453545 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sat, 19 Apr 2025 09:28:24 +0100 Subject: [PATCH] Update CanBeValidated.php --- packages/forms/src/Concerns/CanBeValidated.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/forms/src/Concerns/CanBeValidated.php b/packages/forms/src/Concerns/CanBeValidated.php index 63c7c91ec2..c7c50c24ec 100644 --- a/packages/forms/src/Concerns/CanBeValidated.php +++ b/packages/forms/src/Concerns/CanBeValidated.php @@ -119,6 +119,11 @@ trait CanBeValidated } $livewire = $this->getLivewire(); + + // By storing the currently validating form in the Livewire component, we can optimize the validation process + // so that the `prepareForValidation()` method is only called for the current form instead of all forms. + // This can also prevent infinite loops involving schemas that self-validate, such as the table query + // builder which crashes when it is being used while an action is submitted. $livewire->currentlyValidatingForm($this); try {