spatie / laravel-schemaless-attributes

Add schemaless attributes to Eloquent models
https://spatie.be/en/opensource
MIT License
1.01k stars 58 forks source link

How to use withExtraAttributes method where in this json? #53

Closed ChenRuihua closed 4 years ago

ChenRuihua commented 4 years ago
{
    "officer": {
        "manager": {
            "1": {
                "user_id": "10",
                "memo": "111",
                "phone": "aaa"
            },
            "2": {
                "user_id": "11",
                "memo": "222",
                "phone": "bbb"
            },
            "3": {
                "user_id": "13",
                "memo": "333",
                "phone": "ccc"
            }
        }
    },
    "assistant": {
        "design": {
            "1": {
                "user_id": "3",
                "memo": "111",
                "phone": "aaa"
            },
            "2": {
                "user_id": "4",
                "memo": "222",
                "phone": "bbb"
            },
            "3": {
                "user_id": "5",
                "memo": "333",
                "phone": "ccc"
            }
        }
    }
}

How to selcet the data where manager`s user_id = 11

withExtraAttributes(['officer->manager->user_id' => 11]) does not work

sorry for my poor english.

thank you

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.