php - Laravel multidimensional array get values -


i have

{    "_id": objectid("557a9fd73b308828060025f0"),    "account": {      "email": "mail@gmail.com"    }    "phone": {      "pri": {          "number": "123456789",          "type": "02"      },     "add": {          "number": "456456456",          "type": "03"      }   } } 

i use

$user = sender::where('account.email', '=', 'mail@gmail.com')->first();  // working 

but want search number : 123456789 in array phone->pri

$user = sender::where('phone.pri.number', '=', '123456789')->first();  // not working => return empty array 

please me! thanks!

try

$user = sender::where('phone.pri.number', '=', '123456789')->first(); 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -