Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

in_array validation laravel

in:foo,bar,...

The field under validation must be included in the given list of values. Since 
this rule often requires you to implode an array, the Rule::in method may be 
used to fluently construct the rule:

'field' => 'required|in:' . implode(',', ['value1', 'value2']),
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validation #laravel
ADD COMMENT
Topic
Name
1+3 =