Answer the question
In order to leave comments, you need to log in
Why does laravel validator skip empty image array?
Hello here is the code
$validator = Validator::make($request->all(), [
'image.*' => 'required|image',
'descr.*' => 'string|nullable|max:10000',
'board.*' => 'integer',
'link.*' => 'url|nullable'
]);
if ($validator->fails()) {
return redirect('/upload')->withErrors($validator);
}
Answer the question
In order to leave comments, you need to log in
$validator = Validator::make($request->all(), [
'image' => 'required',
'image.*' => 'image',
'descr.*' => 'string|nullable|max:10000',
'board.*' => 'integer',
'link.*' => 'url|nullable'
]);
if ($validator->fails()) {
return redirect('/upload')->withErrors($validator);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question