How to upload multiple image in laravel 8 ?
ReportQuestion
3 years ago 727 views
foreach($req->file('imageFile') as $file)
{
$name = $file->getClientOriginalName();
$file->move(public_path().'/uploads/', $name);
$imgData[] = $name;
}
$fileModal = new Image();
$fileModal->name = json_encode($imgData);
$fileModal->image_path = json_encode($imgData);
$fileModal->save();
Thread Reply