laravel 8 validation rule multiple code example

Example 1: laravel unique validation on multiple columns

'mobile_no' 
  => 'unique:users,mobile_no,NULL,id,country_id,'.request('country_id');

Example 2: 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);
//@sujay

Example 3: laravel validation

Validator::extend('foo', 'FooValidator@validate');