Josh Thomas
0
Q:

required_without_all laravel

# <values> = foo,bar,...
# <field> = array field
# <characters> = amount of characters

# accepted					           # active_url
# after:<tomorrow>			           # after_or_equal:<tomorrow>
# alpha						           # alpha_dash
# alpha_num					           # array
# bail 					               # before:<today>
# before_or_equal:<today>              # between:min,max
# boolean					           # confirmed
# date						           # date_equals:<today>
# date_format:<format> 		           # different:<name>
# digits:<value>			           # digits_between:min,max
# dimensions:<min/max_with>	           # distinct
# email						           # ends_with:<values>
# exclude_if:<field>,<value>           # exclude_unless:<field>,<value>
# exists:<table>,<column>	           # file
# filled					           # gt:<field>
# gte:<field>				           # image
# in:<values>				           # in_array:<field>
# integer					           # ip
# ipv4                                 # ipv6  
# json						           # lt:<field>
# lte:<field>       		           # max:<value>
# mimetypes:video/avi,...	           # mimes:jpeg,bmp,png
# min:<value>				           # not_in:<values>
# not_regex:<pattern> 		           # nullable
# numeric					           # password:<auth guard>
# present					           # regex:<pattern>
# required					           # required_if:<field>,<value>
# required_unless:<field>,<value>      # required_with:<fields>
# required_with_all:<fields>	       # required_without:<fields>
# required_without_all:<fields>        # same:<field>
# size:<characters>			           # starts_with:<values>
# string						       # timezone
# unique:<table>,<column>		       # url
# uuid
7
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.
0
$request->validate([
    'credit_card_number' => 'required_if:payment_type,cc'
]);
-2

New to Communities?

Join the community