Try casting to the correct type.
Dec 13, 2016
3
Level 5
Mass database update from array
Hello,
I'm trying to update database fields based on excel import. I get the right data from excel, now I can't get it to update the database table on these three fields with these four conditions. It seems to go well, but nothing is updated.
Here is my code:
public function importExcelCall()
{
if(Input::hasFile('import_file')){
$path = Input::file('import_file')->getRealPath();
$data = Excel::load($path, function($reader) {
})->get();
foreach ($data as $key => $value)
{
$update = ['montage' => $value->montage, 'vereinbarung' => $value->vereinbarung, 'kommentar' => $value->kommentar];
owpmontagecallcenter::where('TZIP', $value->tzip)->where('HOUSENO', $value->houseno)->where('SUPPL', $value->suppl)->where('UNIT', $value->unit)->update($update);
}
return redirect('owpmontagecallcenter')->with('status', 'Done.');
}
return redirect()->back()->with('status', 'Something.');
}
Can you help me?
Please or to participate in this conversation.