Fix an image 404 with storage:link

storage:link maps public/storage to storage/app/public. Laravel Cloud does not keep that symlink.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/php-artisan-storage-link-vue.md
storage:link maps public/storage to storage/app/public. Laravel Cloud does not keep that symlink.
Do not commit public/storage as a real directory of uploads.
Do not run this on Laravel Cloud and expect the next deploy to keep it.
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “Laravel storage link Vue” save a file and the <img> is 404. The public disk writes storage/app/public. The browser asks for /storage/.... The link connects them. The upload guide stores the file. The deploy guide says to skip this command on Laravel Cloud.

TL;DR

  • storage:link maps public/storage to storage/app/public.
  • Laravel Cloud does not keep that symlink.
  • Do not commit public/storage as a real directory of uploads.
  • Do not run this on Laravel Cloud and expect the next deploy to keep it.

Who it's for: Laravel + Vue developers

Applies to: Laravel 13 · Vue 3

The fix#

shell
php artisan storage:link

That creates public/storage. Run it once per machine that serves the public disk. The Vue page prints a root-relative URL:

vue
<img v-if="post.cover_url" :src="post.cover_url" alt="" />

cover_url is something like /storage/covers/a.jpg, from Storage::url($path) when the disk is public.

What to avoid#

Gotcha

Do not commit public/storage as a real directory of uploads. The symlink is local. Do not run this on Laravel Cloud and expect the next deploy to keep it. Cloud’s disk resets. User uploads there belong in the bucket the deploy guide points at.

FAQ#

How do I fix an image 404 with storage:link?

storage:link maps public/storage to storage/app/public. Laravel Cloud does not keep that symlink.

What goes wrong with Laravel storage link Vue?

Many developers save a file and the <img> is 404. Do not commit public/storage as a real directory of uploads.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.