Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rafidAhsan's avatar

how to search nested array json object in collections

This is my complex collection

"education" => "[{"key":1,"degree":"Illo reprehenderit h","field_of_study":"Obcaecati dolores si","institution_name":"Bradley Potter","completed":false,"from":"June 2020","actual_from":"2020-06-08","to":"June 2020","actual_to":"2020-06-12","description":"Assumenda culpa unde"}]"
        "contact" => null
        "experience" => "[{"key":1,"designation":"Expedita impedit ip","company_name":"Maxwell and Carver Co","industry":[{"id":2,"name":"3Em4SYAE15"},{"id":3,"name":"QxEgBnqyMt"}],"function":[{"id":2,"name":"Mmz2kZ7sPz"},{"id":4,"name":"j4euusSmaj"}],"sub_function":[{"id":2,"name":"oQHuzrC6Fb"},{"id":5,"name":"QBzunPex20"}],"employment_type":"full-time","current":false,"from":"September 2022","actual_from":null,"to":"September 2022","actual_to":null,"responsibility":"Explicabo Asperiore","country":{"id":19,"name":"Bangladesh"},"city":"Quia aliqua Ex esse","child":[]}]"

how to search experience key my logic is not working

        return Model::where('experience->key', 1)->get();
0 likes
1 reply

Please or to participate in this conversation.