title: Laravel 5 change form request failed validation behavior
body: <p>I have a form request to validate registration data. The application is a mobile API and I would like this class to return formatted JSON in case of a failed validation instead of what it does by default (redirection). </p>
  
  <p>I tried overriding the method <code>failedValidation</code> from <code>Illuminate\Foundation\Http\FormRequest</code> class. but that doesn't seem to work. Any ideas?</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests;
  
  use App\Http\Requests\Request;
  use Illuminate\Contracts\Validation\Validator;
  
  class RegisterFormRequest extends Request {
  
  /**
   * Determine if the user is authorized to make this request.
   *
   * @return bool
   */
  public function authorize() {
      return TRUE;
  }
  
  /**
   * Get the validation rules that apply to the request.
   *
   * @return array
   */
  public function rules() {
      return [
          'email' =&gt; 'email|required|unique:users',
          'password' =&gt; 'required|min:6',
      ];
  }
  
  }
  </code></pre>