You can make a folder under assets. I always just do
<img src="<?php echo asset('assets/upload/imgdogs') . '/' . $row->dogpic; ?>" alt="" class="image">
Look at url helpers in the docs.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Sorry for asking a question that has been asked several times before, but i could not solve my problem yet.
I'm trying to simply save a picture into my local storage, and then to access it's URL.
Here is the controller :
public function uploadProfilePic(Request $request)
{
$user_id = Auth::user()->id;
$path = $request->file('profilePic')->store('profilePics/'.$user_id);
}
The $path above returns a value like : profilePics/1/xGZJVdD3cSoyawPe8ZkZmSNyuKoE8KsTG1UZHoEW.jpeg
And the file is stored as : storage/app/profilePics/1/xGZJVdD3cSoyawPe8ZkZmSNyuKoE8KsTG1UZHoEW.jpeg
1.) Is the above, the right place to store public images, or should they be placed inside storage/app/public
2.) What is the file URL? I tried : www.domain.com/storage/app/profilePics/1/xGZJVdD3cSoyawPe8ZkZmSNyuKoE8KsTG1UZHoEW.jpg , www.domain.com/storage/profilePics/1/xGZJVdD3cSoyawPe8ZkZmSNyuKoE8KsTG1UZHoEW.jpg , www.domain.com/profilePics/1/xGZJVdD3cSoyawPe8ZkZmSNyuKoE8KsTG1UZHoEW.jpg
But none of them seem to work. Filesystems.php configuration is kept default.
Thanks.
If your site is served correctly then the storage folder is not accessible to the outside world
to publish the Storage public folder you run php artisan storage:link
This creates a symbolic link for youwhich makes storage/app/public appear as public/storage
Please or to participate in this conversation.