Q: How can i upload multiple files into a CELL? I tried uploading multiple files into my database but I keep getting just one file, Am using laravel 5.5 all files show on my file directory path but store only one file into my database. Here is my code
my view
<label for="image">{{ __(' image') }}</label>
 <input type="file" name="image[]" class="form-control" value="{{ $employee['image'] }}" multiple>

my route
Route::post('/people/employees/test/{id}', 'EmplController@test');

my controller
if($request->hasfile('image')){
        foreach ($request->image as $image) {
            $path = $image->getClientOriginalName();
            $filename = time() . '-' . $path;
$image->storeAs('employees', $employee->id . '/' . $filename);
            $image->move(public_path('employees'),$filename);
i inserted image here->$employee->image = $filename;
  $employee->save();

  }
}




A: Make an array, and implode it before insert to table, like  :
$files = []; // an empty array
foreach($a as $b) {
   $files[] = $b->name; // insert name to array
}

$files = implode(",", $files); // insert $files into your table

So you need to change on your code :
if($request->hasfile('image')){
        $files = []; // make an array
        foreach ($request->image as $image) {
            $path = $image->getClientOriginalName();
            $filename = time() . '-' . $path;
            $files[] = $filename; // insert to array
$image->storeAs('employees', $employee->id . '/' . $filename);
            $image->move(public_path('employees'), $filename);
         }
         $files = implode(",", $files); // insert $files into your table
}

