title: How to customize JSON format of error in validation in Lumen(Laravel)
body: <p>I am sending error messages like this in case of errors in getting data from DB or any other issue:</p>
  
  <pre><code>return response()-&gt;json(['status' =&gt; 'Failed' ,'state'=&gt;'100' , 'message'=&gt;'You have not registered yet.' ], 401);
  </code></pre>
  
  <p>This gives me a JSON which has everything defined so I easily show the message whatever the problem is.</p>
  
  <p>But in case of error in case of validation, I don't seem to have the power to change the format of the error response JSON.</p>
  
  <pre><code>   $this-&gt;validate($request, [
      'email' =&gt; 'required',
      'password' =&gt; 'required'
      ]);
  </code></pre>
  
  <p>I want to customize the error format as the one given above so that I don't have to change my error showing mechanism.</p>