Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get image from resources folder - Laravel

Can I get and display an image in view from a resources folder instead of public folder? If yes, how can I do that?

like image 417
lili luna Avatar asked Jan 01 '23 06:01

lili luna


1 Answers

resources folder should not be used to store images That's not where public, static assets (like images, js, css etc) should be.

Put them inside public/ folder

The resources/assets/ directory is for storing pre-processed assets, so to speak.

For example, if you have 3 different CSS files but want to merge them into one and render that new single file in the browser (to increase page load speed). In this scenario, the 3 CSS files will be put somewhere inside resources/assets/.

These files can then be processed, and the new merged file will go inside public.

Reference:

https://laracasts.com/discuss/channels/laravel/image-assets?page=1

like image 53
Sehdev Avatar answered Jan 05 '23 10:01

Sehdev