Skip to content
Advertisement

File isn’t recognized ERROR “Call to a member function store() on null” on Laravel file upload

I’m using Laravel, Ajax with Datatables to manage my info, everything was working fine but i need to upload files to it. But i’m getting Call to a member function store() on null.

Here’s the code of the controller functions (post and fetch):

JavaScript

Here’s the code of my script:

JavaScript

And here’s is the code of my blade.php

JavaScript

Advertisement

Answer

It’s not allowing you to store the File because the file it’s not getting to the server because you’re using AJAX to make the request, to send files via AJAX try this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement