From 5615acef9b743edc06b5046387ec5de9f99d1152 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 6 Feb 2025 15:27:29 +0000 Subject: [PATCH] feat: allow dependency injection on form request rules --- src/JsValidatorFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsValidatorFactory.php b/src/JsValidatorFactory.php index 80435496..638033ef 100644 --- a/src/JsValidatorFactory.php +++ b/src/JsValidatorFactory.php @@ -152,7 +152,7 @@ private function newFormRequestValidator($formRequest, $selector) // Replace all rules with Noop rules which are checked client-side and always valid to true. // This is important because jquery-validation expects fields under validation to have rules present. For // example, if you mark a field as invalid without a defined rule, then unhighlight won't be called. - $rules = method_exists($formRequest, 'rules') ? $formRequest->rules() : []; + $rules = method_exists($formRequest, 'rules') ? $this->app->call([$formRequest, 'rules']) : []; foreach ($rules as $key => $value) { $rules[$key] = 'proengsoft_noop'; }