Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error on Multidimensional array search #56

Open
takielias opened this issue Jun 29, 2020 · 3 comments
Open

Getting error on Multidimensional array search #56

takielias opened this issue Jun 29, 2020 · 3 comments

Comments

@takielias
Copy link

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?

@nahid
Copy link
Owner

nahid commented Jul 3, 2020

This is not an issue I think. You are execute a wrong query.

@neeraj479
Copy link

@takielias

Have you solved this query ? if yes please share I am also stuck.

@takielias
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants