I want to download file from storage folder in my Laravel project.
This is the method I'm using to download the file:
return response()->download(storage_path($path), $name);
When I click the link which redirects to this method I receive this output from the browser:
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException The file "pathToTheFile" does not exist.
The problem is that when I go to www.mydomain.com/pathToTheFile, the browser shows me this txt file. Why doesn't it download the file from the link? Anyone can help?
The file is uploaded using Voyager Admin Package if it's important.