Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sinnbeck's avatar
Level 102

Laravel in docker using storage symlink

I am having some issues with the storage symlink when using docker.

php artisan storage:link

I can make the symlink either from inside docker or from the host computer.

Inside docker:

  • Works with urls in the browser.
  • Fails when trying to embed the file inside an email

On host:

  • Works in email embeds
  • Fails in browser urls

Does anyone know of a way to get this working properly?

0 likes
1 reply
aurawindsurfing's avatar

My guess is that it is not docker related.

browser uses

url('path/to/file)

Mail uses absolute path as you would reference that file in a linux operating system like so:

storage_path('path/to/file)

dd() both examples in both environments and you will see the differences.

Hope it helps!

Please or to participate in this conversation.