Laravel 8 image not showing

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Troubleshooting Laravel 8 Image Display Issues: Why Your Files Aren't Showing Up

As a senior developer working with the Laravel ecosystem, one of the most common frustrations newcomers face is getting assets—especially images—to display correctly. You have the file sitting perfectly in your storage directory, you have the correct Blade syntax, and DevTools confirms the path looks right, yet the image remains invisible.

This post will diagnose exactly why this happens in a Laravel 8 environment, provide the definitive solution, and ensure your assets are served correctly to the browser.

The Root Cause: Storage Link is Missing

The vast majority of "image not showing" issues when dealing with files stored in the storage directory stem from a fundamental misunderstanding of how Laravel handles public file access.

When you store files in the storage disk (which defaults to the local filesystem), these files are not automatically accessible via the web root (public) by default for security reasons. To make these files publicly readable by the web server, you must explicitly create a symbolic link. This is the crucial step often missed.

Your code snippet suggests you are referencing a path like storage/subject_image/. While this path exists within your application structure, the browser cannot access it unless Laravel has created the necessary public bridge.

The Essential Fix: Creating the Storage Link

To resolve this, you must run a specific Artisan command to link the storage directory to the public directory. This command creates a symbolic link (symlink) that allows web requests to access files stored in storage/app/public through the web-accessible path (public/storage).

Run the following command in your terminal:

php artisan storage:link

What this does: This command creates a new directory at public/storage. Any file placed inside storage/app/public (or, depending on configuration, within the main storage folder if you are using specific disk configurations) is now accessible via the URL structure starting with /storage/.

If your files are truly in storage/app/subject_image/, you should ensure that when you store them, they reside within the public-facing storage area established by this link. For best practice, most developers use the public disk driver for assets, which manages this linking automatically if configured correctly.

Correcting the Blade Implementation

Once the storage link is established, we need to ensure your Blade syntax uses the correct helper functions to reference these public files. The asset() helper is perfect for generating URLs relative to the application's public directory.

Based on your attempt:

<img src="{{asset('storage/subject_image/' . $data->subject_image)}}" alt="">

Correction and Best Practice:

If you have followed the storage:link step, the path should reference what is accessible via the public URL structure. Since the link maps public/storage to storage/app/public, the correct way to reference an image stored in a subdirectory is:

<img src="{{ asset('storage/subject_image/' . $data->subject_image) }}" alt="Subject Image">

Notice that we are now correctly combining the base public path (storage/) with the relative folder structure. This ensures that when Laravel renders this view, it generates a URL that the browser can successfully fetch from the web server.

Summary and Conclusion

The problem you encountered is not a bug in your Blade syntax or an issue with the file itself; it is an access permission and linking issue inherent to how Laravel manages file storage outside of the standard public folder structure.

  1. Step 1 (Prerequisite): Always run php artisan storage:link to establish the bridge between your application's storage and the web-accessible public directory.
  2. Step 2 (Implementation): Use the asset() helper correctly, ensuring the path starts from the root of what is publicly accessible (storage/).

By following these steps, you ensure that your Laravel application functions smoothly and adheres to modern web development practices, making it easier to manage assets and follow best practices outlined by the community, such as those promoted on resources like Laravel Company. Happy coding!