File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed
Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,6 @@ protected function getMessages() : array
3434 return [];
3535 }
3636
37- /**
38- * The validator.
39- *
40- * @return \Illuminate\Contracts\Validation\Validator
41- */
42- private $ validator ;
43-
4437 /**
4538 * Returns an instance of the validator from our container.
4639 *
@@ -59,14 +52,11 @@ private function getValidationFactory() : Factory
5952 */
6053 private function getValidator () : Validator
6154 {
62- if (is_null ($ this ->validator )) {
63- $ this ->validator = $ this ->getValidationFactory ()->make (
64- $ this ->getData (),
65- $ this ->getRules (),
66- $ this ->getMessages ()
67- );
68- }
69- return $ this ->validator ;
55+ return $ this ->getValidationFactory ()->make (
56+ $ this ->getData (),
57+ $ this ->getRules (),
58+ $ this ->getMessages ()
59+ );
7060 }
7161
7262 /**
@@ -123,9 +113,12 @@ public function getErrors() : MessageProvider
123113 */
124114 public function getValidationFailureReasons () : array
125115 {
126- if ($ this ->isInvalid ()) {
127- return $ this ->getValidator ()->failed ();
116+ $ validator = $ this ->getValidator ();
117+
118+ if ($ validator ->fails ()) {
119+ return $ validator ->failed ();
128120 }
121+
129122 return [];
130123 }
131124
You can’t perform that action at this time.
0 commit comments