Answers for "custom error message in laravel"

PHP
3

email validation in laravel

'email' => 'required|email|unique:users,email',
//@sujay
Posted by: Guest on October-09-2020
2

give custom field name in laravel form validation error message

$this->validate([
  'userid' =>'required|min:3|max:100',
  'username' =>'required|min:3',
  'password' =>'required|max:15|confirmed',
], [], [
  'userid' => 'User ID'
]);
Posted by: Guest on September-20-2021
9

laravel validator make custom message

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

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

    $this->validate($request, $rules, $customMessages);
Posted by: Guest on May-06-2020
1

validation error message in laravel

@if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
Posted by: Guest on August-04-2021
1

how to add an custom error to validater error in laravel

if (request('event') == null) {
    $validator->errors()->add('event', 'Please select an event');
}
Posted by: Guest on October-20-2020
1

laravel custom validation message

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

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

    $this->validate($request, $rules, $customMessages);
Posted by: Guest on November-24-2020

Code answers related to "custom error message in laravel"

Browse Popular Code Answers by Language