@judev You use public disk, so it should be like this
<img src="{{ asset("storage/{$image}") }}" alt="thumbnails">
Hello.
I'm trying to show images what i have stored the path into the database and a foreign key that references the product the column has name product_id, i have also use this command of artisan php artisan storage:link to get the relation of storage and public folder, so that was ok image are stored into /storage/public/image.
So i'm storing images like this everything work well :
if ($request->file('filename')){
foreach ($request->file('filename') as $img){
$path = $img->store('image', 'public');
$image = new Image();
$image->path = $path;
$image->products_id = $product->id;
$image->save();
}
}
//Yes i know i can use mass assignement but i prefer this method.
So after that i'm using this to show the image in blade files :
$image // are the first image that query builder will get to show one images for the product thumbnails.
<img src="{{ asset($image) }}" alt="thumbnails">
//I have also try this
<img src="{{ asset('public/'.$image) }}" alt="thumbnails">
so the image don't are not displayed someone have solved the same problem ??
@judev In your public folder exists symlink to storage folder?
And it should be like this
<img src="{{ asset("storage/{$image->path}") }}" alt="thumbnails">
Please or to participate in this conversation.