A simple guide and example for uploading and displaying images stored in Laravel’s storage folder.
This repo contains code snippets and examples from the Itstuffsolutions article: "Laravel 12 Display Image From Storage Folder".
Laravel, by default, does not expose files stored in storage/app to the web.
This example demonstrates two primary ways to serve images stored in Laravel’s storage:
- Public symbolic link approach — easiest for public images
- Controller-based streaming — best for restricting access or controlling headers
- How to store uploaded files to the
publicdisk - How to create the
storage:linkfor public access - Using
Storage::url()to generate URLs - Displaying images in Blade views
- Building a secure controller method to stream images
- Setting MIME types and handling "not found" cases
- Tips for permissions and path issues
You’ll need:
- PHP (compatible version with Laravel 12)
- Composer
- A Laravel 12 project
- Web server (Apache, Nginx, etc.)
- (Optional) local environment: Laravel Sail, Valet, or Homestead