Mansu's avatar
Level 1

How to access the image from storage?

I have uploaded the pictures in a storage folder

/public_html/storage/app/public/images

็How can I show the image in blade? I already done the command php artisan storage:link

It's work ok in my local but I can't show it in my livesite

0 likes
8 replies
martinbean's avatar
Level 80

@mansu Show how you’re trying to access the images.

Also, your storage directory should not be in the public_html directory.

Mansu's avatar
Level 1

My storage is in public_html where I should place it then?

Mansu's avatar
Level 1

This is the way I am trying to access the images

<img src="{{ url('storage/'.$image) }}" alt="" class="d-inline-block img-fluid" width="100" height="80">
amirkamizi's avatar

in order to get the image something like the code below should work:

storage('app/public/images/image_name')

but as @martinbean said your storage folder shouldn't be in public_html

Rosa66's avatar

When you use the storage:link command, you create a symbolic link between your storage/app/public folder and your public/storage folder. So now you can find your files at the url $BASE_URL/storage/img/logo png. I recommend you to use the asset helper function inside your blade template:https://www.mybalancenow.today/

Mansu's avatar
Level 1

It works on local but not the live site Do you think is about the permission

Please or to participate in this conversation.