A
A
andreyqin2014-11-25 12:08:43
Laravel
andreyqin, 2014-11-25 12:08:43

Laravel: how to remove :attribute substitution in error message template?

Hello.
We have a validation.php file with validation error messages. Each message is substituted with the name of the field in which the error occurred. How to make sure that without changing this file, in a certain validation, we did not substitute the field name in the message. That is, the message "FieldName is required." should just look like "Required field."

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
miki131, 2014-11-25
@miki131

You will have to change some file in any case, why not choose validation.php ?!
It has an attributes section - insert your "defined validations" there like this:

'attributes' => [
      'FieldName' => '',	    
  ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question