i am trying to hook to the login even in my L5 app to set last login time and IP address. i can make it work with the following:
Event::listen(\'auth.login\'
Open up EventServiceProvider.php and in boot method you can listen for 'auth.login' event via callback.
public function boot(DispatcherContract $events)
{
parent::boot($events);
$events->listen('auth.login', function()
{
dd('logged in event');
});
}
You may want to create listener so you move callback function somewhere else. Do that following this http://laravel.com/docs/4.2/events#using-classes-as-listeners