title: Declaration of formatErrors() should be compatible with FormRequest::formatErrors in laravel
body: <p>For using <a href="https://laravel.com/docs/5.0/validation#form-request-validation" rel="noreferrer">Form Request Validation</a> in laravel, I created a <strong>StoreCourseRequest</strong> class like this : </p>
  
  <pre><code>namespace App\Http\Requests;
  
      use App\Http\Requests\Request;
      use Illuminate\Validation\Validator;
  
  class StoreCourseRequest extends Request
      {
          public function authorize ()
          {
              return true;
          }
  
          public function rules ()
          {
              return [
                  'title'       =&gt; 'required',
                  'description' =&gt; 'required'
              ];
          }
  
          public function messages ()
          {
              return [
                  'title.required'       =&gt; 'عنوان دوره را وارد کنید',
                  'description.required' =&gt; 'توضیحات دوره را وارد کنید',
              ];
          }
  
  
          protected function formatErrors(Validator $validator)
          {
  
              $result = ['success' =&gt; false, 'msg' =&gt; $validator-&gt;errors()-&gt;first()];
  
  return $result;
              }
  
          }
  </code></pre>
  
  <p>Because all request sends as Ajax, I want to customize format of error messages as you see in above code.</p>
  
  <p>But after sending request , error below is occurred :</p>
  
  <pre><code>ErrorException in StoreCourseRequest.php line 9:
  Declaration of App\Http\Requests\StoreCourseRequest::formatErrors() should be compatible with Illuminate\Foundation\Http\FormRequest::formatErrors(Illuminate\Contracts\Validation\Validator $validator)
  </code></pre>
  
  <p>I think that all things is right and follow docs instruction to create formrequest Class but i do not know what is that error and Why occurs?</p>