Display the folder image for the view Laravel

前端 未结 2 696

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 displ

相关标签:
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') }}">
    
    0 讨论(0)
  • 2020-12-12 04:22

    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">
    
    0 讨论(0)
提交回复
热议问题