Answers for "laravel validation exists array"

PHP
1

how to check exist in array in rule validation laravel

['someProperty' => ['required', Rule::in(['needed', 'stuff'])]];
Posted by: Guest on October-10-2021
0

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']),
Posted by: Guest on December-01-2020

Code answers related to "laravel validation exists array"

Browse Popular Code Answers by Language