Skip to content

Commit 6b5ac8b

Browse files
author
Samuel
committed
Fixed validation status code and title
1 parent 95cb1b6 commit 6b5ac8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Handlers/ValidationHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ValidationHandler extends AbstractHandler
1313
*/
1414
public function handle()
1515
{
16-
$errors = (new ErrorCollection)->setStatusCode(400);
16+
$errors = (new ErrorCollection)->setStatusCode(422);
1717

1818
$failedFieldsRules = $this->getFailedFieldsRules();
1919

@@ -49,7 +49,7 @@ public function handle()
4949
public function getValidationTitle(array $failedFieldsRules, string $key, string $field)
5050
{
5151
$title = __('exception::exceptions.validation.title', [
52-
'fails' => array_keys($failedFieldsRules[$field])[$key],
52+
'fails' => strtolower(array_keys($failedFieldsRules[$field])[$key]),
5353
'field' => $field,
5454
]);
5555

0 commit comments

Comments
 (0)