E
E
Eugene2015-02-17 00:46:23
Laravel
Eugene, 2015-02-17 00:46:23

How to set in validator in laravel with an array?

Example of using in validator

$values = ['one', 'two', 'three'];
\Validator::make($input, ['value' => 'in:one,two,three']);

Is it possible to set this rule simply by passing an array without resorting to such perversion?
\Validator::make($input, ['value' => 'in:' . implode(',', $values)]);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question