Problem with Count laravel

1

I have the following which works perfect but if I want to also bring another data like the user_id that is inside the same table where I do the count it gives me an error. Alquilen knows what the solution might be?

public function scopeCantidadclientes($arvg){
    return $arvg->select(DB::raw('count(credito_id) as cantidad'),'credito_id')
                ->groupBy('credito_id')
                ->get(); }
    
asked by user107861 21.11.2018 в 15:27
source

0 answers