Support the ongoing development of Laravel.io →
Input Database Forms

####Like this image is going in DB ["image1","image2","image3"] but I want like this image1,image2,image3

###here is my controller code images are going in folder

..if($request->hasFile('image')){ .....$file = $request->file('image'); ......foreach($file as $files){ ......$name = $files->getClientOriginalName(); ......#imagelist[] = $name; ......$sell->image = json_encode($imagelist); .....} .....$sell->save(); ...} ..}

This please help...

Last updated 3 years ago.
0

If you just want a string, then replace

$sell->image = json_encode($imagelist);

with

$sell->image = implode(',', $imagelist);
Last updated 9 years ago.
0

woww thanx man it's working need one another help I want to fetch 1 image to show on home page after that i want to fetch all images in my gallery please suggest..

0

Sign in to participate in this thread!

PHPverse

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.

© 2025 Laravel.io - All rights reserved.