I think you need to provide more context so we can help you, in the meantime check the docs https://laravel.com/docs/10.x/filesystem#retrieving-files
you need to provide the full path to the file \storage\images\posts\filename.extention
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am facing issue with image. Image is being stored at directory :
<img src="{{ asset("storage/$post->image") }}" width="1000" height="500">
but when I try to display image on webpage. It is being fetched from:
/storage/images/posts/7PxSl786DpTzl1Txtebv3sYInKzVDnLiMRBx9u9R.png"
The error on console is:
Failed to load resource: the server responded with a status of 404
When I run command:
PHP artisan storage:link
it says:
The [D:\New folder\htdocs\blog-cms-main\public\storage] link has been connected to [D:\New folder\htdocs\blog-cms-main\storage\app/public].
I don't know what is the problem. I hope I have added all the information that could be required. Any help would be apperciated.
@rehman_ali Have you checked the directory to see if the folder structure is correct and if the file exists in the folder?
I suggest you delete the symbolic link from the public folder and run the command PHP artisan storage:link again.
Normally I would create a dedicated disk like post
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'post' => [
'driver' => 'local',
'root' => storage_path('app/public/posts'),
'url' => env('APP_URL').'/posts',
'visibility' => 'public',
'throw' => false,
],
'links' => [
public_path('posts') => storage_path('app/public/posts'),
],
];
then you can store the image like so
$path = Storage::disk('post')->putFile('', $request->file('postImag'));
or through the request object
$path = $request->file('postImag')-> storeAs( '','filename', 's3');
you can also create a method on the Post model to access the image url like so
public function imageUrl()
{
return Storage::disk('posts')->url($this->image);
}
then you can access it in the view like so <img src="{{$post->imageUrl() }}" width="1000" height="500">
Caleb Pozio the creator of Livewire explains this concept in a video here better: https://laravel-livewire.com/screencasts/s5-filesystem-disks
Please or to participate in this conversation.