title: Argument 1 passed t be an instance of Illuminate\Http\Request, array given
body: <p>Why am I getting the following error?</p>
  
  <pre><code>Argument 1 passed to App\Http\Controllers\Controller::validate() must be an instance 
  of Illuminate\Http\Request, array given, called in 
  app/Http/Controllers/Admin/Auth/AuthController.php on line 72 and defined
  </code></pre>
  
  <p><strong>Functions:</strong></p>
  
  <pre><code>protected function loginValidation($request)
      {
          $rules = array(
            'fname' =&gt; 'required|max:255',
            'lname'  =&gt; 'required|max:255',
            'email'      =&gt; 'required|email|max:255|unique:users',
            'password'   =&gt; 'required|min:6|confirmed',
      );
          $this-&gt;validate( $request , $rules);
      }
    protected function getLoginCredentials(Request $request)
    {
      $validator = $this-&gt;loginValidation(Request::all());
  
      var_dump($validator); die();
  
      if($validator-&gt;passes())
      {
      return[
      'email'    =&gt; Request::input('email'),
      'password' =&gt; Request::input('password'),
      'type'     =&gt; 1  
      ];
  
      return true;
      }else{
          return redirect()-&gt;back()-&gt;withErrors();
      }
    }  
  </code></pre>
  
  <p><strong>Updated Code:</strong></p>
  
  <pre><code>public function validate($request, $rules)
      {
          $rules = array(
            'fname' =&gt; 'required|max:255',
            'lname'  =&gt; 'required|max:255',
            'email'      =&gt; 'required|email|max:255|unique:users',
            'password'   =&gt; 'required|min:6|confirmed',
      );
          $this-&gt;validate( $request , $rules);
      }
  
  
  
  protected function getLoginCredentials(Request $request)
    {
      $validator = $this-&gt;validate($request, $rules);
  
      if($validator-&gt;passes())
      {
      return[
      'email'    =&gt; Request::input('email'),
      'password' =&gt; Request::input('password'),
      'type'     =&gt; 1  
      ];
  
      return true;
      }else{
          return redirect()-&gt;back()-&gt;withErrors();
      }
    }  
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Declaration of App\Http\Controllers\Admin\Auth\AuthController::validate() should be compatible with App\Http\Controllers\Controller::validate(Illuminate\Http\Request $request, array $rules, array $messages = Array, array $customAttributes = Array)
  </code></pre>