I have a question, is it possible to count where estado is = 1?
$array = Tickets::groupBy('rrpp')->selectRaw('rrpp, count(*) as quantity, count(*) as estado, '=', 1')->get();
>Solution :
you can try query like this:
$array = Tickets::groupBy('rrpp')->selectRaw('rrpp, count(*) as quantity, sum(case when estado = 1 then 1 else 0 end) as count_of_estado_1')->get();