如何从视图中检查控制器中的输入类型文件或隐藏在laravel中。
@if(isset($input_data['list_image_filename1']))
<label for="list_image_filename1">{{ $input_data['list_image_filename1'] }}</label>
<input type="hidden" name="list_image_filename1" value="{{ $input_data['list_image_filename1'] }}">
@else
<input class="form-control" name="list_image_filename1" type="file" id="list_image_filename1">
@endif
答案 0 :(得分:0)
public function processForm(Request $request)
{
if ($request->file('list_image_filename1')) {
// it's file input
} elseif ($request->has('list_image_filename1')) {
// it's hidden input
}
}