Issue
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 = User::find($user_id);
$total = Helper::totcost();
// dd($tot_amt);
$user->totcosty = $total;
$user->save();
}
Solution
array to string means you are sending an array to the database but db will not accept it you have to explode() the array before sending it to db... Hope it will help!
Answered By - void
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.