I’m quite new to Laravel, so patience with me.
I’m in the middle of the process of replicating a framework that I developed in node / react to laravel. Right now, I’m adjusting the main architecture and currently working on a blade master page.
Goal 1:
I want to load images using the blade {{ asset() }} helper in a template page. The thing is that I want to load the images from a subfolder that resides inside the resources folder:
/resources/app_files_layout
I know that I could do this by moving the folder to the public directory, but that’s not what I have in mind. My intention is also to advance on a deeper learning and understanding on the laravel framework and try to maintain an architectural fidelity with my framework on other languages.
Goal 2:
After I manage to load the images from the /resources/app_files_layout through {{ asset() }} helper in blade, I’d like to use an alias for the route in the source code. Example: Instead of displaying in the output HTML in the browser http://localhost/app_files_layout/image-name.jpg, I’d like it to display: http://localhost/images/image-name.jpg and never show the user that the files are in a app_files_layout folder.
Is what I’m trying to do possible at all in laravel?
Worst case scenario:
If laravel doesn’t have the necessary architecture to do what I want, I could settle for setting up a route that displays the image in the /resources/app_files_layout folder. That is: when I access on the browser http://localhost/images/image-name.jpg should load an image located in /resources/app_files_layout/image-name.jpg.
I tried to follow this stackoverflow suggestion: https://stackoverflow.com/a/38736973/2510785 However, returned me an error like so:
The requested resource /files-layout-test/backend-layout-header-tb02-03.jpg was not found on this server.
Thanks, in advance!