jeudi 6 février 2020

Array to string conversion (SQL: update `users` set `updated_at` = 2020-02-06 08:05:19, `totcosty` = 5040 where `id` = 60)

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

this is the function

 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