I am programming in Laravel 5.5
and I need to compare a query with an integer to perform a verification. The code is as follows:
$sum_=DB::table('eventos_tienen_trabajadores as ett')
->where('ett.id_trabajador', '=', $id)
->where('ett.estado', '=', '1')
->select(DB::raw('sum(monto) as sum'))
->get();
if($sum_ == 0){...
Of course it is not possible to compare it, so I would like to know how I can do this efficiently.