I was trying to find sum of different column using Query Builder. Here is Query :
DB::table('carts')
->sum(\DB::raw('carts.price+COALESCE(carts.support,0)+COALESCE(carts.installation,0)' ))
->where('status','=',1)
->where('user_id','=',$id);
But when i dd()
the output i got the above Error.ie,
Call to a member function where() on float
How do i avoid that?