When the button clicked, it is supposed to open a file of \"resume.pdf\" in a blank page. It works fine with localhost, but when it is executed on heroku, it doesn\'t go through
So, this answer has two parts.
The first is that storage
isn't publicly accessible by default. Per the docs:
To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public. This convention will keep your publicly accessible files in one directory that can be easily shared across deployments when using zero down-time deployment systems like Envoyer.
(You probably did this locally once, but forgot. Or, your local server is running out of the app's main folder instead of the public
subfolder.)
BUT...
On Heroku, the filesystem is ephemeral. It is not permanent. Files you store on the instance can go away at any time. If you do a new deploy, or if you scale up/down, or if Heroku needs to restart/replace an instance, alllllll the files your users have uploaded to storage
are wiped out.
Instead, you'll want to store user uploads somewhere like Amazon S3, which Laravel makes easy. Once you've configured your S3 keys, you can just do stuff like Storage::disk('s3')
to work with S3 instead of the local, soon-to-be-erased disk.