I need to display vendors without repeat, but i have large bd. Here is my query:
$model = Driver::select(DB::raw('vendor, COUNT(' . $field . ') AS s'))-
>groupBy('vendor')->pluck('s', 'vendor')->toArray();
It displays how many drivers have each vendor and returm massive: I'm using twig template and when i try to display this massive with this code:
It's just show me numbers, but i need vendors names. I tried to use
groupBy('vendor')
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire