Answer the question
In order to leave comments, you need to log in
How to insert variable into laravel validation rule?
There is validation:
$v = Validator::make($this->request->all(), [
'type' => 'required|in:1,2,3,4',
]);
Answer the question
In order to leave comments, you need to log in
$v = Validator::make($this->request->all(), [
'type' => 'required|in:1,2,3,'.$peremennaya,
]);
$v = Validator::make($this->request->all(), [
'type' => "required|in:1,2,3,{$peremennaya}",
]);
$v = Validator::make($this->request->all(), [
'type' => "required|in:".implode(',', $massiv_peremennih),
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question