Muhammad Manamil on November 10, 2025
Laravel 12 has made file and storage handling even smoother — but many developers still face the common error:
“The asset cannot be found” or “storage:link not working.”
This usually happens when your storage symbolic link isn’t properly connected to the public/storage directory.
In this guide, we’ll fix this error step-by-step so your images, uploads, and assets load perfectly.
When you upload files (like user images or documents) in Laravel, they are stored in:
storage/app/public
But for browsers to access them publicly, Laravel creates a symbolic link:
public/storage → storage/app/public
If this link is missing or broken, your images won’t show — and you’ll get the storage asset error.
Run this artisan command from your project root:
php artisan storage:link
This will create a link between:
public/storage → storage/app/public
Now your files should be accessible via:
{{ asset('storage/filename.jpg') }}
Sometimes you might see:
Error: The "public/storage" directory already exists.
To fix it:
rm -rf public/storage
php artisan storage:link
This removes the old broken link and creates a fresh one.
Make sure the storage directories have correct permissions:
chmod -R 775 storage
chmod -R 775 bootstrap/cache
If you’re on Linux or Ubuntu, you can also set ownership:
sudo chown -R www-data:www-data storage
sudo chown -R www-data:www-data bootstrap/cache
This ensures Laravel can write and read files properly.
Use this format in your Blade templates:
<img src="{{ asset('storage/file name.jpg') }}" alt="Profile Picture" />
❌ Don’t use /storage/app/public/ — that’s a private directory.
✅ Always use asset('storage/...') or url('storage/...').
.env ConfigurationMake sure your .env file includes:
FILESYSTEM_DISK=public
And your config/filesystems.php has:
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
If you made any changes, clear the config cache:
php artisan config:clear
If you’re on a shared hosting (like cPanel) and php artisan storage:link doesn’t work,
you can manually create a symbolic link using SSH:
ln -s /home/username/project/storage/app/public /home/username/public_html/storage
Or use Laravel’s custom command inside a deployment script to recreate the link automatically.
That’s it! You’ve successfully fixed the Laravel 12 storage:link asset error.
Now your uploaded images and files will display correctly without broken links.
If you’re setting up Laravel on a new server, make sure to always:
php artisan storage:linkAPP_URL and FILESYSTEM_DISK in .envphp artisan storage:link do in Laravel?The php artisan storage:link command creates a symbolic link between public/storage and storage/app/public.
This allows files stored in Laravel’s storage folder to be publicly accessible via the browser.
This usually happens when the public/storage folder already exists, or when you don’t have the correct permissions.
Delete the existing link and recreate it:
rm -rf public/storage
php artisan storage:link
Simply remove the existing directory and run the command again:
rm -rf public/storage
php artisan storage:link
This will create a fresh symbolic link.
storage:link. Why?Check these points:
File exists in storage/app/public
You used the correct path in Blade:
<img src="{{ asset('storage/file name.jpg') }}" />
Proper permissions are set (chmod -R 775 storage)
.env includes FILESYSTEM_DISK=public
On shared hosting, artisan commands may be restricted.
Use SSH and run this command manually:
ln -s /home/username/project/storage/app/public /home/username/public_html/storage
Or ask your hosting provider to create the symbolic link for you.
FILESYSTEM_DISK setting in .env?Use:
FILESYSTEM_DISK=public
This ensures that files uploaded using Laravel’s Storage facade are stored in the public disk and can be accessed publicly.
storage:link after every deployment?Yes, ideally you should.
When deploying Laravel to a new server or after clearing files, the symbolic link may not exist — running php artisan storage:link ensures all file assets work correctly.
Yes. You can create custom symbolic links using:
php artisan storage:link --relative
or manually specify paths via config/filesystems.php.
However, using the default public link is recommended for simplicity and compatibility.
The storage:link command creates a secure way to serve user-uploaded files while keeping them outside the public directory for security reasons.
It depends on your hosting provider. Some allow symbolic links, while others don't. Contact your provider or use alternative methods like serving files through controllers.
The public disk is a filesystem configuration, while storage:link creates a symbolic link to make files in storage/app/public accessible via the web.
Create a test file in storage/app/public and try to access it via your browser using the /storage/ URL.
Check file permissions
Verify directory existence
Check server symbolic link support
Use manual symbolic link creation
Contact your hosting provider
Yes, you can define multiple links in your config/filesystems.php file.
Yes, but your user-uploaded files won't be accessible via the web until you recreate the link.
Featured Posts
Categories
November 10 2025
Getting Started with Laravel 12 Starter Kits (React/Vue/Livewire)Discover how to kickstart your Laravel 12 projects with the most popular starter kits—React, Vue, and Livewire. Step-by-step guidance for setting up, configuring, and building your first app efficiently.
November 03 2025
Laravel Installation on Ubuntu with Nginx – Complete Configuration GuideLaravel is the ultimate free and open-source PHP framework designed for building fast, secure, and reliable web applications. It has quickly become the industry standard thanks to its powerful, cohesive toolset that guarantees a streamlined development process for any modern PHP project.
November 05 2025
Laravel Cloud vs Vapor — Which One Should You Choose in 2026?Trying to choose between Laravel Cloud and Laravel Vapor? This guide explores their main differences — from pricing and performance to deployment style and scalability — so you can confidently pick the right hosting solution for your Laravel app in 2026
© 2025 — Revision. All Rights Reserved.