Support the ongoing development of Laravel.io →
Database Views Blade
Last updated 2 years ago.
0

please help some one.....

0

Hi,

You can try array_first() function to print first array.

[https://laravel.com/docs/5.2/helpers#method-array-first]

Last updated 8 years ago.
0

You need to get your images back into an array

// explode images into an array
$images = explode(',',$val->image);

// first image
echo $images[0];

// multiple images - loop through images
foreach($images as $image)
{
    echo $image;
}
0

where shoul i have to create $images variable in my controller or in my view ...if i have to create a valriable in view i have crated variable after that passed but it's not working here is my code for view

$images = explode(',', $val->image);

<img src="images/test/{{$val->images[0] }}">

i'm new sorry for mistakes

0

Sign in to participate in this thread!

Eventy

Your banner here too?

techiva techiva Joined 9 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.