mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
31 lines
586 B
PHP
Executable File
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();
|
|
}
|
|
} |