I am getting this error "Call to a member function update() on array" and I have no idea why, is it because I am updating an array? I have check other resources similar to this but not much related to array so I am not sure what to do. Thank you in advance
Information: I am trying to update an HTML table but kept getting this error
Controller:
public function update1(Request $request, $id){
$object2 = qualification::find($id);
$object2 = array();
$object2['School'] = implode(' , ', $request->School);
$object2['SDate'] = implode(' , ', $request->SDate);
$object2['EDate'] = implode(' , ', $request->EDate);
$object2['qualification'] = implode(' , ', $request->qualification);
$object2->update();
return redirect('/home');
}
qualification model:
class qualification extends Eloquent
{
protected $fillable = array('School', 'user_id', 'SDate', 'EDate', 'qualification');
// DEFINE RELATIONSHIPS --------------------------------------------------
public function personal_infos() {
return $this->belongsTo('App\personal_info');
}
}
$object2
?? – fubar