I have this form
<form class="" enctype="multipart/form-data" action="{{route('submit_prop')}}" method="POST">
<div class="margin-btm-sm">
<label>Main Image</label>
<input type="file" name="main_img" class="form-control" />
</div>
<div class="margin-btm-sm">
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
when submit the form the request array (POST array) is empty. but when remove enctype="multipart/form-data" from form
<form class="" action="{{route('submit_prop')}}" method="POST">
the request array has data.
Controller Method:
function submit(SubmitPropRequest $request, $id=null) {
dd(\Request::all());
}
Request Contoller:
public function rules()
{
dd(\Request::all());
return [
'main_img' => 'image|mimes:png,jpg,jpeg',
];
}
what is the issue? i know the enctype is a must when submit a file. I used it in Laravel 5.0 and everything was ok why ij Laravel 5.1 did not work.