mercredi 19 février 2020

Laravel using whereIn and orderBy together

I'm using whereIn on my query it works but when i try to add orderBy it doesn't affect the order of results.

$products = Product::whereIn('id', $this->products)->orderBy('created_at', 'asc')->get();

How can I make it work this query? Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire