1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
invoiceninja/app/handlers/UserEventHandler.php
Hillel Coren b99427b05c Bug fixes
2014-03-23 21:38:03 +02:00

31 lines
586 B
PHP
Executable File

<?php
class UserEventHandler
{
public function subscribe($events)
{
$events->listen('user.signup', 'UserEventHandler@onSignup');
$events->listen('user.login', 'UserEventHandler@onLogin');
$events->listen('user.refresh', 'UserEventHandler@onRefresh');
}
public function onSignup()
{
}
public function onLogin()
{
$account = Auth::user()->account;
$account->last_login = Carbon::now()->toDateTimeString();
$account->save();
Event::fire('user.refresh');
}
public function onRefresh()
{
Auth::user()->account->loadLocalizationSettings();
}
}