Skip to content

Conversation

@smoakey
Copy link
Contributor

@smoakey smoakey commented Jan 23, 2018

The formatting of validation messages always replaces:attribute with a humanized version of the data key. IE:

$data = [
     'user_ids' => [1,2,3]
];

$rules = [
    'user_ids' => 'array'
];

When $data['user_ids'] is not an array the error message is:

The User ids must be array

This PR allows setting humanized keys on/off via:

$validator = new \Rakit\Validation\Validator;
$validator->setUseHumanizedKeys(false);
....

@emsifa
Copy link
Member

emsifa commented Jan 25, 2018

Ah, this would be useful. Thanks.

@emsifa emsifa merged commit 40837c4 into rakit:master Jan 25, 2018
@smoakey smoakey deleted the feature/humanized_attribute_key branch January 27, 2018 19:29
@smoakey
Copy link
Contributor Author

smoakey commented Jan 27, 2018

Thanks a bunch @emsifa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants