Skip to content

Commit 851f396

Browse files
committed
Flipped singleErrorPerField to arrayErrors
1 parent 79b6ee4 commit 851f396

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Middleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Middleware
2626
*
2727
* @var bool
2828
*/
29-
protected $singleErrorPerField = true;
29+
protected $arrayErrors = false;
3030

3131
/**
3232
* Determine the current asset version.
@@ -160,7 +160,7 @@ public function resolveValidationErrors(Request $request)
160160

161161
return (object) collect($bags)->map(function ($bag) {
162162
return (object) collect($bag->messages())->map(function ($errors) {
163-
return $this->singleErrorPerField ? $errors[0] : $errors;
163+
return $this->arrayErrors ? $errors : $errors[0];
164164
})->toArray();
165165
})->pipe(function ($bags) use ($request) {
166166
if ($bags->has('default') && $request->header(Header::ERROR_BAG)) {

tests/Stubs/ArrayErrorsMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class ArrayErrorsMiddleware extends ExampleMiddleware
77
/**
88
* @var bool
99
*/
10-
protected $singleErrorPerField = false;
10+
protected $arrayErrors = true;
1111
}

0 commit comments

Comments
 (0)