Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

Customizing the validation error messages and fixed arguments #266

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

mohammad-fouladgar
Copy link
Contributor

@mohammad-fouladgar mohammad-fouladgar commented Jan 21, 2018

Fixed missing arguments in the validationErrorMessages method. #261

We can have more control to compute the validation messages.

For example :

public function validationErrorMessages($root, $args, $context)
    {
        $inavlidEmail = array_get($args, 'test_with_rules_input_object.nest.email');

        return [
             'test.required' => 'A test is required.',
             'test_with_rules_input_object.nest.email.email' => 'Invalid your email : '.$inavlidEmail,
          ];
    }

@dmongeau Thank you !

@mohammad-fouladgar mohammad-fouladgar changed the title Add the arguments to the validationErrorMessages method Customizing the validation error messages and fixed arguments Jan 21, 2018
@dmongeau dmongeau merged commit 4599f75 into folkloreinc:develop Feb 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants