Hi,
You can try array_first() function to print first array.
[https://laravel.com/docs/5.2/helpers#method-array-first]
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;
}
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community