1

How can I access a direct image from storage?

I'm saving the images from my project in storage/images/clients/ how do I retrieve those images and display them for the view?

Bruno Silva
  • 147
  • 1
  • 11
  • This seems to be a follow-up to your previous question https://stackoverflow.com/questions/48171822/laravel-where-and-how-to-save-a-file-image; be sure to either close/delete that question if it's not needed. – Tim Lewis Jan 09 '18 at 21:56

2 Answers2

2

You need to create a symbolic link between the storage/images and public/images:

ln -s /full/path/to/storage/images /full/path/to/public/images

Then you'll be able to use these images:

<img src="{{ asset('images/clients/john.jpg') }}">
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
0

To retrieve the raw content of the file use:

$contents = Storage::get('/path/to/file.jpg');

But if you just trying to display it in the view, there no need for any special cumbersome method, Simply use

<img src="/path/to/file.jpg">
Marvin
  • 41
  • 1
  • 5