mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 00:11:35 +02:00
38 lines
634 B
PHP
38 lines
634 B
PHP
<?php namespace App\Listeners;
|
|
|
|
use Auth;
|
|
use Carbon;
|
|
use App\Events\UserLoggedIn;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Contracts\Queue\ShouldBeQueued;
|
|
|
|
class HandleUserLoggedIn {
|
|
|
|
/**
|
|
* Create the event handler.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the event.
|
|
*
|
|
* @param UserLoggedIn $event
|
|
* @return void
|
|
*/
|
|
public function handle(UserLoggedIn $event)
|
|
{
|
|
$account = Auth::user()->account;
|
|
$account->last_login = Carbon::now()->toDateTimeString();
|
|
$account->save();
|
|
|
|
$account->loadLocalizationSettings();
|
|
}
|
|
|
|
}
|