Laravel validation - the input must be one of the elements in the array

Is there a built-in validator in Laravel 5 that checks to see if there is a value in the array of my whitelist values, like a speaker. Sort of:

$rules = [ 'field_name' => "required|in_array('yes', 'no', 'maybe')", ]; 
+6
source share
1 answer

There in

 $rules = [ 'field_name' => "required|in:yes,no,maybe", ]; 
+16
source

Source: https://habr.com/ru/post/988439/


All Articles