title: Laravel: validate json object
body: <p>It's the first time i am using validation in laravel. I am trying to apply validation rule on below json object. The json object name is payload and example is given below.</p>
  
  <pre><code>payload = {
    "name": "jason123",
    "email": "email@xyz.com",
    "password": "password",
    "gender": "male",
    "age": 21,
    "mobile_number": "0322 8075833",
    "company_name": "xyz",
    "verification_status": 0,
    "image_url": "image.png",
    "address": "main address",
    "lattitude": 0,
    "longitude": 0,
    "message": "my message",
    "profession_id": 1,
    "designation_id": 1,
    "skills": [
      {
        "id": 1,
        "custom" : "new custom1"
      }
     ]
  }
  </code></pre>
  
  <p>And the validation code is like below, for testing purpose i am validating name as a digits. When i executed the below code, the above json object is approved and inserted into my database. Instead, it should give me an exception because i am passing name with alpha numeric value, am i doing something wrong:</p>
  
  <pre><code>public function store(Request $request)
  {
  
      $this-&gt;validate($request, [
          'name' =&gt; 'digits',
          'age' =&gt; 'digits',
          ]);
  }
  </code></pre>