i want to update user with below code but problem is that its update balance perfectly but also giving error in LOgs. and i am unable to figureout issue also tried
findorfail()
production.ERROR: Creating default object from empty value {"exception":"[object] (ErrorException(code: 0):
public function updateBalance(){
$gnl = General::first();
$deposit = Deposit::where('status', 1)->get();
foreach($deposit as $de){
$pack = Package::Where('id',$de->plan)->first();
$log = Deposit::Where('id',$de->id)->first();
$percent = $log->amount * $pack->percent/100;
$repercent = $percent/1440 ;
$tup = Track::where('account_id',$de->account_id)->first();
$tup->balance +=$repercent; //here getting error line
$tup->save();
}
}