1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/handlers/UserEventHandler.php

31 lines
586 B
PHP
Raw Normal View History

2013-12-15 13:55:50 +01:00
<?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()
{
2014-01-30 23:29:09 +01:00
2013-12-15 13:55:50 +01:00
}
public function onLogin()
{
2014-03-23 20:38:03 +01:00
$account = Auth::user()->account;
$account->last_login = Carbon::now()->toDateTimeString();
$account->save();
2013-12-15 13:55:50 +01:00
2014-03-23 20:38:03 +01:00
Event::fire('user.refresh');
2013-12-15 13:55:50 +01:00
}
public function onRefresh()
{
2014-01-06 19:03:00 +01:00
Auth::user()->account->loadLocalizationSettings();
2013-12-15 13:55:50 +01:00
}
}