We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cf47d1 commit 3d34658Copy full SHA for 3d34658
src/Former/Former.php
@@ -4,6 +4,7 @@
4
use Closure;
5
use Illuminate\Container\Container;
6
use Illuminate\Validation\Validator;
7
+use Illuminate\Support\MessageBag;
8
9
/**
10
* Helps the user interact with the various Former components
@@ -260,6 +261,9 @@ public function withErrors($validator = null)
260
261
// If we're given a raw Validator, go fetch the errors in it
262
if ($validator instanceof Validator) {
263
$this->errors = $validator->getMessageBag();
264
+
265
+ } else if ($validator instanceof MessagBag) {
266
+ $this->errors = $validator;
267
}
268
269
return $this->errors;
0 commit comments