Im getting the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'value' in 'where clause' (SQL: select sum(gross) as value, first_name from
clients
left jointransactions
onclients
.id
=transactions
.client_id
wherevalue
> 0 group byfirst_name
)
From this function?
$data = DB::table('clients')->leftjoin('transactions','clients.id','=','transactions.client_id')
->select(DB::raw('sum(gross) as value, first_name'))
->where('value','>',0)
->groupBy('first_name')
->get();
return $data;