Answers for "laravel required_without"

PHP
1

required_without_all laravel

1. required_with:foo,bar,...
  
Use Case: The field under validation must be present and not empty only if any 
=========  of the other specified fields are present.

2. required_with_all:foo,bar,...
  
Use Case: The field under validation must be present and not empty only if all 
=========   of the other specified fields are present.

3. required_without:foo,bar,...

Use Case: The field under validation must be present and not empty only when 
========  any of the other specified fields are not present.

4. required_without_all:foo,bar,...

Use Case: The field under validation must be present and not empty only when 
=========  all of the other specified fields are not present.
Posted by: Guest on October-14-2020
1

laravel unique validation

unique:table,column,except,idColumn

############## Example : ################

############### For Updating  
//rules
'email' => 'unique:users,email_address,' . $userId,

############### For Creating 
//rules
'email' => 'unique:users,email_address',
Posted by: Guest on October-26-2020
0

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
Posted by: Guest on November-30-2020

Browse Popular Code Answers by Language