jeudi 26 mars 2020

Laravel collection filter

{
    {
        id: 125,
        apartments: [
            {
                floor: 28,
            },
            {
                floor: 29,
            }
        ],
    },
    {
        id: 126,
        apartments: [
            {
                floor: 25,
            },
            {
                floor: 29,
            }
        ],
    },
    ....
}

It is sample collection data.

Now I want to filter this collection by floor attribute. For example, I want to get only floor == 29 I want to get all the data that including floor == 29.

How can I filter it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire