vendredi 13 novembre 2020

doesnthave() taking too long to query in laravel

I am write database query which fetch the record which does not have specific relation i am simply counting the number of records which doesn't have relation . But it is taking too long .

Here is my query

 Consignment::doesntHave('invoice_charges')->count()

But when I write query without relation it gives me quick result


Consignment::count()

What could be the reason . And how i can make it work?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32HhGHY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire