Level 8
Is the data (file) in your request?
I used the same code form Laravel Documentation in my other controller it worked fine and now it's not working in another form. Anyone with idea why I get the above error. Thanks
My Controller
public function postDeal(Request $request)
{
$this->validate($request, [
'file' => 'required|max:2048',
]);
$path = $request->file('file')->store('Uploads');
$deal = new Deal([
'file' => $path,
]);
$deal->save();
}
My Form
form action="{{ route('deal.request')}}" method="POST" enctype="multipart/form-data">
@csrf
<input type="file" name="file" id="file">
<button type="submit">Submit Request</button>
</form>
Please or to participate in this conversation.