title: How can I validate json data in laravel?
body: <p>My code to validate data like this : </p>
  
  <pre><code>public function register(Request $request)
  {
      //echo '&lt;pre&gt;';print_r($request-&gt;all());echo '&lt;/pre&gt;';die();
      $this-&gt;validate($request, [
          'email'=&gt;'required',
          'password'=&gt;'required',
          'data_cache.dataCache.id'=&gt;'required|numeric'
          'data_cache.dataCache.quantity'=&gt;'required|numeric'
      ]);
  }
  </code></pre>
  
  <p>The result of <code>echo '&lt;pre&gt;';print_r($request-&gt;all());echo '&lt;/pre&gt;';die();</code> like this :</p>
  
  <pre><code>Array
  (
      [data_cache] =&gt; {"dataCache":{"id":112,"quantity":1,"information":"stamford bridge","request_date":"15-08-2017 02:30:00"},"expired":"2017-08-14T16:30:26.272Z"}
      [email] =&gt; chelsea@gmail.com
      [password] =&gt; 87654321
  )
  </code></pre>
  
  <p>The data_cache is json data</p>
  
  <p>On the view blade, I add this to display the message validation :</p>
  
  <pre><code>@if ($errors-&gt;has('data_cache'))
      &lt;span class="help-block"&gt;
          &lt;strong&gt;{{ $errors-&gt;first('data_cache') }}&lt;/strong&gt;
      &lt;/span&gt;
  @endif
  </code></pre>
  
  <p>If the code executed, there is no display message validation</p>
  
  <p>Seems the validation json data is still wrong</p>
  
  <p>How can I do it correctly?</p>