dimanche 13 décembre 2020

How to sort by column in nested object in laravel

How to sort by object property which is indside of another object

I am fetching data from database and after fetching data I need to sort it. I want to sort it by cost column which is in new object provider_product Here is the object


owner_phone: "0422429136"

phone: ""
provider_product: [{id: 1, product_id: 1, provider_id: 1, cost: 7, created_at: null, updated_at: null}]
rfc: "sasa"

How I can do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire