title: How to enable locked user again on laravel after 3 wrong attempts on login
body: <p>Hello i am using the following code security and it is working. But I wanted to know how to enable the lock account again as per code:</p>
  <pre><code>if ($this-&gt;hasTooManyLoginAttempts($request)) {
              $this-&gt;fireLockoutEvent($request);
              return redirect('/login')-&gt;withErrors(array('error' =&gt; 'Your account has been disabled because of too many wrong attempts'));
          }
  </code></pre>
  <pre><code>        //check if user is deactivated by admin
          $user = User::where('email', $request-&gt;email_username)-&gt;first();
          if ($user &amp;&amp; !$user-&gt;active) {
              return redirect('/login')-&gt;withErrors(array('error' =&gt; 'Your account has been disabled by an administrator.'));
          }
  
          // If the login attempt was unsuccessful we will increment the number of attempts
          // to login and redirect the user back to the login form. Of course, when this
          // user surpasses their maximum number of attempts they will get locked out.
          $this-&gt;incrementLoginAttempts($request);
  
          // If the class is using the ThrottlesLogins trait, we can automatically throttle
          // the login attempts for this application. We'll key this by the username and
          // the IP address of the client making these requests into this application.
          if ($this-&gt;hasTooManyLoginAttempts($request)) {
              $this-&gt;fireLockoutEvent($request);
              return redirect('/login')-&gt;withErrors(array('error' =&gt; 'Your account has been disabled because of too many wrong attempts'));
          }
  
          if(isset($user) &amp;&amp; !empty($user)){
              $request-&gt;session()-&gt;forget('password_expired_id');
  
              $password_updated_at = $user-&gt;passwordSecurity-&gt;password_updated_at;
              $password_expiry_days = $user-&gt;passwordSecurity-&gt;password_expiry_days;
              $password_expiry_at = Carbon::parse($password_updated_at)-&gt;addDays($password_expiry_days);
              if($password_expiry_at-&gt;lessThan(Carbon::now()) || $user-&gt;force_reset == &quot;1&quot;){
                  $request-&gt;session()-&gt;put('password_expired_id',$user-&gt;id);
                  auth()-&gt;logout();
                  return redirect('/passwordExpiration')-&gt;with('message', &quot;Your Password is expired, You need to change your password.&quot;);
              }
          }
  </code></pre>