4jZW7jVSdS4U6PC's avatar

[L5] Image upload and viewing

Hello Everyone.

I'm trying to upload image on my L5 demo application.

I can upload them and I'm using two main things to do so. First the Flysystem in order to create the directory inside storage folder The common path for a new image is storage/app/images/{id}/{name}_format.extension For example storage/app/images/69/whitecat_original.jpg

The upload part is working fine, however I don't understand how to view that. In laravel 4 I used to use asset() helper function in my view life


<img src="{{ asset($photo->url) }}" /> 

Where $photo->url were previously generate inside my controller and was pointed to public/images/{id}/{name}_formate.extension but now I can't use it anymore because assets() refers to the public path and not the storage one.

How can i solve that?


<img src="{{ something }}" />

0 likes
7 replies
bestmomo's avatar
Level 52

Why not a directory in public path ?

4jZW7jVSdS4U6PC's avatar

@bestmomo like I've done in L4 then. I thought that since Storage:: is binded to the storage folder by default I would have to save the images there... My bad

jekinney's avatar

Not a waste of time. Glad you figured it out.

1 like

Please or to participate in this conversation.