vendredi 27 novembre 2015

Returning the custom validation method parameter in error message

I have a created a custom validation function along with a custom error message for it. How can I show the value "1000" in my error message?

  // in my request file
  function rules() 
  {
    return [
        'my_field' => 'myValidator:1000',
    ];    
  }

  // in my custom validator file
  public function validateMyValidator($attribute, $value, $parameters)
  {
      return true;
  }

  // in resources/lang/eng/validation.php
  'custom' => [
    'my_field' => [
        'my_validator' => 'Value must be 1000',
    ],
  ]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire