laravel 5 multidimensional array validation

I send json like this via ajax

how I can validate it in controller ?

{
    "category": "Lorem ipsum dolor",
    "portions": 1,
    "title": "Lorem ipsum dolor sit amet",
    "percent": 100,
    "ingredients": [
      {
        "count": "2 consectetur adipisicing",
        "name": "exercitation ullamco"
      },
      {
        "count": "¼ exercitation ullamco",
        "name": "aliqua. Ut enim "
      }
    ],
    "image": "http://......1435015831.83.jpg",
    "tags": [
      "irure dolor",
      "nulla pariatur"
    ],
    "steps": [
      {
        "image": null,
        "number": 1,
        "description": "proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
      },
      {
        "image": null,
        "number": 2,
        "description": "incididunt ut labore et dolore magna aliqua.."
      }
    ],
    "favorite": 53,
    "duration": "5"
}


Source: laravel

Leave a Reply