Skip to content
Advertisement

how to display multiple images on laravel view

i need help displaying multiple images on laravel, so far I can upload and save the images to the path public_path().’images/listing/’.$listing->id.’/’.$name;.

but I not sure how to display each individual image path correctly on my blade file and display the saved images

my ListingController

JavaScript

the listing.blade.php

JavaScript

Advertisement

Answer

From what I can see public_path() gives your full path to your public folder from the root filesystem. And often in laravel web application development you don’t want the full path from the filesystem while rendering the file. You only want it at the time of moving the file so it can point to proper location from the root filesystem. In laravel you want the path from the public folder so.

Use this as a code.

JavaScript

And then on your view use

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement