laravel custom message for findorfail code example
Example 1: laravel validation custom message example
$rules = [
'name' => 'required',
'email' => 'required|email',
'message' => 'required|max:250',
];
$customMessages = [
'required' => 'The :attribute field is required.'
];
$this->validate($request, $rules, $customMessages);
Example 2: laravel custom abort message
php artisan vendor:publish --tag=laravel-errors
update the error page file according to the code
@section('message', __($exception->getMessage() ?: 'Server Error'))