jsonq
jsonq copied to clipboard
Getting error on Multidimensional array search
This is my json array
[
{
"name": "post11",
"type": "fields",
"fields": [
{
"name": "background_color",
"type": "select",
"options": {
"rules": "required",
"value": "#FFFFFF",
"wrapper": {
"class": "col-md-6"
},
"choices": {
"#ECECEC": "Grey",
"#FFFFFF": "White"
},
"selected": "#ECECEC",
"content_type": "select",
"error_messages": {
"background_color.required": "Background Color is mandatory."
}
}
},
{
"name": "post1_title",
"type": "text",
"options": {
"wrapper": {
"class": "col-md-6"
},
"value": "",
"rules": "required",
"content_type": "text"
}
}
]
},
{
"name": "post12",
"type": "fields",
"fields": [
{
"name": "post1",
"type": "textarea",
"options": {
"wrapper": {
"class": "col-md-6"
},
"rules": "required|min:5",
"value": "",
"content_type": "textarea",
"error_messages": {
"post1.required": "Post1 is mandatory."
}
}
},
{
"name": "modal1_view",
"type": "textarea",
"options": {
"wrapper": {
"class": "col-md-6"
},
"content_type": "editor",
"attr": {
"class": "form-control editor"
},
"value": ""
}
}
]
},
{
"name": "post13",
"type": "fields",
"fields": [
{
"name": "internal1_url",
"type": "text",
"options": {
"wrapper": {
"class": "col-md-6"
},
"value": "",
"content_type": "text"
}
},
{
"name": "image1",
"type": "file",
"options": {
"wrapper": {
"class": "col-md-6"
},
"value": "",
"content_type": "text"
}
}
]
},
{
"attr": {
"class": "btn btn-primary pull-right"
},
"name": "submit",
"type": "submit"
}
]
I need to search content_type = editor.
$jsonq->from("fields")->where("content_type", "=", "select")->get();
But I'm getting
ErrorException
array_filter() expects parameter 1 to be array, object given
How can I fix it?
This is not an issue I think. You are execute a wrong query.
@takielias
Have you solved this query ? if yes please share I am also stuck.
@takielias
Have you solved this query ? if yes please share I am also stuck.
Sorry, I could not make it. I'm also looking for a solution.