Level 4
a little more detail will do
Hello. I am looking for a solution here. I want to keep multiple images in a single row.
if($request->hasFile('files')){
foreach ($request->file('files') as $file) {
$files = $file->store('public');
$fileName = (explode('/',$files))[1];
$host = $_SERVER['HTTP_HOST'];
$projectImage = 'http://'.$host.'/storage/'.$fileName;
DB::table('projects')->insert([
'project_name' => $addProjectName,
'project_des' => $addProjectDes,
'project_link' => $addProjectLink,
'project_image' => $projectImage,
'project_image1' => $projectImage,
'project_image2' => $projectImage,
'project_image3' => $projectImage,
'project_image3' => $projectImage,
'project_image5' => $projectImage,
'project_image6' => $projectImage,
'project_image7' => $projectImage,
'project_image8' => $projectImage,
'project_image9' => $projectImage,
'project_image10' => $projectImage,
]);
}
}
I want each picture to be inserted on the specific column. But in this case, it creates a new row for each image.
Please or to participate in this conversation.