php - Format Form Validation Message in Laravel 5
478
How to format form validation error message in laravel 5 like below ??
The Date is not a valid date.
How to format form validation error message in laravel 5 like below ??
The Date is not a valid date.
People are also looking for solutions to the problem: php - Add category to send grid mail using web api
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
Find the answer in similar questions on our website.
Answer
Solution:
You can set custom validation messages in the resources/lang/en/validation.php file:
If you want the attribute to be bold on all date validation messages (regardless of the field name), then you can set the message for the
date
key:Answer
Solution:
use str_replace and then ask blade to parse the output as an html text, like this:
Answer
Solution:
If you're using the basic validation error display and want to show the name of the field in bold, you can:
Using the 'en' language as an example.
Add the name of the field in a language file (resources/lang/en/validation.php) inside the attributes key:
In the validation message display, just change the {{ $error }} to {!! $error !!}