On a website, validation errors and full-page errors are ways to show the user that the request does not proceed so they should be as clear as crystal.
Customize Validation Errors
For customizing the rule and attribute of validation Laravel has a separate file called validation.php in
resources/lang/xx/validation.php.
If you just want to edit the validation message you should define your custom message with attribute name in the “custom” array.
'custom' => [
'name' => [
'required' => 'Please Enter Your Name'
],
],
For customizing the attributes name just add your attribute name in the “attributes” array
'attributes' => [
'name' => 'Full Name',
],
Customize Error Pages
Laravel 8 error pages are in the vendor folder so you need to publish those pages into resources/views
php artisan vendor:publish --tag=laravel-errors
after publishing pages, you have access to them in
resources/views/errors
Feel free to edit the messages or the whole layout.
Top comments (1)
Awesome tutorial . Thanks for sharing..