Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jordz's avatar
Level 1

How to use image tag in Laravel to display Image?

I'm using another way to view image. But the image is not showing only the thumbnail. This is my code below in Laravel controller.

foreach($data as $d) {

$resort_picture1 = '<img src="{{asset("images/Resort Pictures"'.$resort->resort_picture1.')}}" alt="logo">';

$active = 'Active';

$action = '      ';

}

0 likes
4 replies
tykus's avatar
tykus
Best Answer
Level 104

Don't use Blade braces unless in a Blade template:

$resort_picture1 = '<img src="' . asset("images/Resort Pictures/" . $resort->resort_picture1) . '" alt="logo">';
1 like
Jordz's avatar
Level 1

@tykus it shows the same output the image is not showing only the thumbnail. :(

tykus's avatar

@Jordz the path is probably incorrect in that case; where is the image actually stored?

Jordz's avatar
Level 1

@tykus sorry, my mistake haha I forgot to refresh the page, It actually work. Thankyou very much to your help :)

Please or to participate in this conversation.