Search code examples
imageincludelaravel-bladelaravel-6

Laravel include image in Blade file not from public folder


I need to include an image in a blade from my source folder without passing from the public folder, this due the blade is used to generate a pdf file, not a view for a public page. How can I do this? Every answer/example I found uses the public folder, but I don't need it.


Solution

  • You can use storage_path() to retrieve a file from storage and include it.

    Ref: https://laravel.com/docs/5.7/helpers#method-storage-path