File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff 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 )) {
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ class ArrayErrorsMiddleware extends ExampleMiddleware
77 /**
88 * @var bool
99 */
10- protected $ singleErrorPerField = false ;
10+ protected $ arrayErrors = true ;
1111}
You can’t perform that action at this time.
0 commit comments