title: Laravel request service return json
body: <p>When you validate your data using a request service how do you return the the errors in json format like e.g. </p>
  
  <pre><code>return response-&gt;json(array("errors' =&gt; true, 'errors' =&gt; $errors));
  </code></pre>
  
  <p>Request Service:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests;
  
  use App\Http\Requests\Request;
  use Auth;
  
  class MyRequest extends Request
  {
      /**
       * Determine if the user is authorized to make this request.
       *
       * @return bool
       */
      protected $action;
  
      public function authorize()
      {
          if(Auth::check()) {
              return true;            
          }        
      }
  
      public function validate() {
          return parent::validate();
      }
  
      public function all()
      {
  
      }
  
      public function messages()
      {
      }    
  
      public function rules()
      {               
  
      }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function store(MyRequest $request) {
      $mymodel = new MyModel();
      $mymodel-&gt;title = 'test';
      $model-&gt;save();
  }
  </code></pre>