jeudi 6 février 2020

Laravel Array to string conversion error while updating database

I want to update a totcosty field in the User table but it is throwing this error everytime and it is not updating the field

this is the function for execution:

public static function cost(){
  $user_id = auth()->user()->id;
  $user = User::find($user_id);
  $total = Helper::totcost();
  // dd($tot_amt);
  $user->totcosty = $total;
  $user->save(); 
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire