hjortur17's avatar

Storage link

Hi, I have image upload on my website and when I upload an image it goes to the storage folder. I already tried to generate a link between the storage folder and the public folder with: php artisan storage:link but that didn't work. Any ideas?

0 likes
6 replies
rin4ik's avatar

it created public/storage folder ?

hjortur17's avatar

Yes it did, but I'm trying to run threads with foreach and getting the image link thru database like: img src="{{ asset($threads->first()->image) }}"

rin4ik's avatar

you can use storage_path() or public_path() <img src="{{public_path('/storage/' . $threads->first()->image)}} " alt="">

1 like
rin4ik's avatar
rin4ik
Best Answer
Level 50

try this as well

img src="{{ asset('/storage/' . $threads->first()->image) }}"
1 like
rin4ik's avatar

@hjortur17 you are welcome. you can use previous one I had a mistake now I updated.

1 like

Please or to participate in this conversation.