1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/handlers/UserEventHandler.php
2014-01-31 00:29:09 +02:00

31 lines
602 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();
}
}