lundi 3 juillet 2017

Laravel 5.1 query has undesired "limit 1"

This never happened to me before

return $this->model->newQuery()
    ->where('canonical', true)
    ->groupBy('systemUrl')
    ->having('n', '>', 1)
    ->select('systemUrl', \DB::raw('count(*) as n'))
    ->pluck('systemUrl')->toArray();

This code produces the desired query, except it output an unexpected limit 1.

How is that possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire