Skip to content

PHP code snippet – How to change validation message in laravel?

$rules = [
        'name' => 'required',
        'email' => 'required|email',
        'message' => 'required|max:250',

    $customMessages = [
        'required' => 'The :attribute field is required.'

    $this->validate($request, $rules, $customMessages);
See also  How to add up a list in Python?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.