lundi 6 février 2017

Why is Laravel 5.4 throwing a Type error here?

I have this in my App\Providers\EventServiceProvider:

protected $listen = [
    'Illuminate\Auth\Events\Login' => [
      'App\Listeners\UserLogin'
    ],
];

and this in my App\Listeners\UserLogin.php:

use App\Events\UserLoggedIn;

class UserLogin
{
  public function handle(UserLoggedIn $event)
  {
    ...
  }
}

but when I try to log in I get this error:

Type error: Argument 1 passed to App\Listeners\UserLogin::handle() must be an instance of App\Events\UserLoggedIn, instance of Illuminate\Auth\Events\Login given.

So can anyone tell me why I have this error?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2leYZDf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire