title: How do I track authentication in Laravel using satellizer
body: <p>I would like to count how many times a user has been logged in using Events in Laravel. </p>
  
  <p>I am using third party library '<strong>satellizer</strong>' for authentication, and I have defined an AuthLoginEventHandler which looks as below:</p>
  
  <pre><code>&lt;?php namespace App\Handlers\Events;
  
  use Illuminate\Queue\InteractsWithQueue;
  use Illuminate\Contracts\Queue\ShouldBeQueued;
  use App\User;
  use Illuminate\Support\Facades\Log;
  
  class AuthLoginEventHandler {
  
      /**
       * Create the event handler.
       *
       * @return void
       */
      public function __construct()
      {
           Log::info('Logged in User is working from constructor');
      }
  
      /**
       * Handle the event.
       *
       * @param  User $user
       * @param  $remember
       * @return void
       */
      public function handle(User $user, $remember)
      {
          Log::info('Logged in');
  
          $user-&gt;login_counter = 1;
          $user-&gt;save();
          $user-&gt;increment('login_counter');
      }
  
  }
  </code></pre>
  
  <p>In AuthenticationController I have:</p>
  
  <pre><code>public function authenticate(Request $request)
  {
      $credentials = $request-&gt;only('email', 'password');
  
      try {
          // verify the credentials and create a token for the user
          if (! $token = JWTAuth::attempt($credentials)) {
              return response()-&gt;json(['error' =&gt; 'invalid_credentials','status'=&gt;false], 401);
          }
      } catch (JWTException $e) {
          // something went wrong
          return response()-&gt;json(['error' =&gt; 'could_not_create_token','status'=&gt;false], 500);
      }
  
      Log::info('Logged in User from JWT');
      Event::fire(new AuthLoginEventHandler());
      // if no errors are encountered we can return a JWT
      return response()-&gt;json(compact('token'));
  }
  </code></pre>
  
  <p>The problem is the handle() method never gets called when I am firing the event from the authenticate() function inside AuthenticationController.</p>
  
  <p>I can see the constructor is being called but not the handle function, WHat I am missing here, and is there any other way I could achieve such thing!</p>
  
  <p>Thanks</p>