title: Argument 1 passed to App\Http\Controllers\Auth\LoginController::authenticated()
body: <p>Help me understand and solve such errors. </p>
  
  <p>ERROR : </p>
  
  <blockquote>
    <p>Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
    Type error: Argument 1 passed to App\Http\Controllers\Auth\LoginController::authenticated() must be an instance of App\Http\Controllers\Auth\Request, instance of Illuminate\Http\Request given, called in C:\proj\easywash\vendor\laravel\framework\src\Illuminate\Foundation\Auth\AuthenticatesUsers.php on line 104</p>
  </blockquote>
  
  <hr>
  
  <p>Login Controller : </p>
  
  <pre><code>    &lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\Http\Controllers\Controller;
  use Illuminate\Foundation\Auth\AuthenticatesUsers;
  use Illuminate\Http\Request;
  use App\Http\Requests;
  use Auth;
  class LoginController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Login Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles authenticating users for the application and
      | redirecting them to your home screen. The controller uses a trait
      | to conveniently provide its functionality to your applications.
      |
      */
  
      use AuthenticatesUsers;
  
      /**
       * Where to redirect users after login.
       *
       * @var string
       */
      protected $redirectTo = '/home';
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest', ['except'=&gt; ['logout','userLogout']]);
      }
  
      public function authenticated(Request $request, $user)
          {
              if (!$user-&gt;verified) {
                  auth()-&gt;logout();
                  return back()-&gt;with('warning', 'You need to confirm your account. We have sent you an activation code, please check your email.');
              }
              return redirect()-&gt;intended($this-&gt;redirectPath());
          }
  
      public function userLogout()
      {
          Auth::guard('web')-&gt;logout();
          return redirect('/home');
      }
  }
  </code></pre>
  
  <p>Register Controller :</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Auth;
  use App\User;
  use App\Mail\VerifyMail;
  use App\Http\Controllers\Controller;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Foundation\Auth\RegistersUsers;
  use App\VerifyUser;
  use Auth;
  use DB;
  use Mail;
  use Illuminate\Http\Request;
  
  class RegisterController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Register Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users as well as their
      | validation and creation. By default this controller uses a trait to
      | provide this functionality without requiring any additional code.
      |
      */
  
      use RegistersUsers;
  
      /**
       * Where to redirect users after registration.
       *
       * @var string
       */
      protected $redirectTo = '/home';
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'name' =&gt; 'required|string|max:255',
              'email' =&gt; 'required|string|email|max:255|unique:users',
              'password' =&gt; 'required|string|min:6|confirmed',
  
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return \App\User
       */
      protected function create(array $data)
      {
                 $user = User::create([
                      'name' =&gt; $data['name'],
                      'email' =&gt; $data['email'],
                      'password' =&gt; bcrypt($data['password']),
                  ]);
  
                  $verifyUser = VerifyUser::create([
                      'user_id' =&gt; $user-&gt;id,
                      'token' =&gt; str_random(40)
                  ]);
  
                  Mail::to($user-&gt;email)-&gt;send(new VerifyMail($user));
  
                  return $user;
  
  
      }
  
      public function verifyUser($token)
      {
          $verifyUser = VerifyUser::where('token', $token)-&gt;first();
          if(isset($verifyUser) ){
              $user = $verifyUser-&gt;user;
              if(!$user-&gt;verified) {
                  $verifyUser-&gt;user-&gt;verified = 1;
                  $verifyUser-&gt;user-&gt;save();
                  $status = "Your e-mail is verified. You can now login.";
              }else{
                  $status = "Your e-mail is already verified. You can now login.";
              }
          }else{
              return redirect('/login')-&gt;with('warning', "Sorry your email cannot be identified.");
          }
  
          return redirect('/login')-&gt;with('status', $status);
      }
      protected function registered(Request $request, $user)
      {
          $this-&gt;guard()-&gt;logout();
          return redirect('/login')-&gt;with('status', 'We sent you an activation code. Check your email and click on the link to verify.');
      }
  
  
     }
  </code></pre>