i want to update a first record status into '2' based on button click. Here is my code :
public function repay(Request $request,$loanid){
$obj = DB::table('schdls')
->where('schdls.loanid','=',$loanid)
->where('schdls.status','=',1)->first();
$obj->status='2';
$obj->save();
return redirect('/home')->with('message','updated');
}
But it says Call to undefined method stdClass::save() error,
What am i missing?