Laravel - Image saved in storage folder not showing to user

Laravel - Image saved in storage folder not showing to user

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

The Storage Link Gap: Why Your Laravel Images Disappear

When an image uploads successfully to storage/app/uploads but fails to render in the browser, the issue is rarely about file permissions or disk space. It is almost exclusively a configuration gap between your local filesystem and the public web server. In your specific case, the Blade template attempts to access /storage/app/..., but unless that directory is explicitly exposed via your web server, the URL returns a 403 or 404 error.

The root cause lies in how Laravel serves files by default. When you run php artisan storage:link, Laravel creates a symbolic link from public/storage to storage/app. This allows requests like /storage/images.jpg to be resolved correctly by the web server (Apache, Nginx, or PHP's built-in server). Without this link, the web server cannot find files sitting inside the storage directory because it is outside the document root.

Diagnosing the Storage Link

The first step is verifying whether the symbolic link exists. Navigate to your project root and run:

ls -la public/storage

If you see a line similar to lrwxrwxrwx 1 user group ... -> ../app, the link is present. If you only see an empty directory or no entry, the link is missing. To create it, execute:

php artisan storage:link

This command creates the necessary bridge for Apache and Nginx to serve files stored in storage/app without needing to change configuration files like .htaccess. If you are using a custom web server or a framework like Symfony that expects a different setup, this standard Laravel link might not suffice, but for most local development environments and standard production stacks, this is the solution.

Validating the Storage Configuration

While the filesystem link is the primary fix, it is worth checking config/filesystems.php to ensure you aren't inadvertently pointing to the wrong disk. Laravel uses a "disk" abstraction to manage storage locations. By default, the public disk is configured as:

'disks' => [
    'public' => [
        'driver' => 'local',
        'root'  => storage_path('app/public'),
        ...
    ],
],

Notice the root path: storage_path('app/public'). This corresponds to storage/app/public on your filesystem. When you use $file->storeAs(...), Laravel saves directly into storage/app/uploads. Your Blade template correctly points to /storage/app/..., which relies entirely on the symlink created by storage:link.

If you were using the s3 driver or a remote disk, the path logic would differ, but for local storage, the symlink is mandatory.

Alternative: Using the Public Disk Directly

Some developers prefer to bypass the /storage/app path entirely and store files directly in public/uploads. This approach eliminates the need for the symbolic link entirely. To do this, change your storage command to target a public folder:

$path = $file1->storeAs(
    'uploads', 
    $i.time().".$extension", 
    'public' // Specify the 'public' disk defined in config/filesystems.php
);

By specifying 'public' as the third argument to storeAs, Laravel moves the file directly into public/uploads. You can then update your Blade template to reference /uploads/... instead of /storage/app/uploads/.... This method is often cleaner for production environments where you want to avoid managing symlinks, though it increases write permissions on the web root directory.

Security Considerations

Regardless of which path you choose, ensure that images are not executed as code. If you store user-uploaded files in a public folder, be cautious about file extensions. While your current code generates a unique filename using time(), this prevents collisions but does not strip malicious MIME types. Always validate the file extension against a whitelist before saving.

Additionally, if you move to a shared hosting environment or a server where storage:link fails due to permission restrictions on the symlink target, you may need to configure your web server to follow symlinks explicitly in .htaccess:

Options +FollowSymLinks
AllowOverride All

In summary, your image saves correctly because Laravel writes to the disk successfully. The "file not found" error is a web server routing issue resolved by linking public/storage to storage/app.

Our network