How to access Laravel symbolic link when uploaded to Heroku
Adnan's answer has two issues;
- If you use
heroku run bash
to execute a command, it's only executed in a one-off dyno. So this won't effect the live dyno. - The
php artisan storage:link
command generates a symlink with an absolute path. So when you'd run this during build, it'd map the absolute path of a temp build directory, instead of the final app's directory on the dyno.
I used a simple relative symlink to link both directories and add it to your git repository:
cd public/ && ln -s ../storage/app/public storage && cd ..