mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-23 20:10:52 +00:00
33 lines
524 B
PHP
33 lines
524 B
PHP
<?php
|
|
|
|
namespace App\Listeners;
|
|
|
|
use App\User;
|
|
use Illuminate\Auth\Events\Login;
|
|
use IlluminateAuthEventsLogin;
|
|
|
|
class SetLanguage
|
|
{
|
|
/**
|
|
* Create the event listener.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the event.
|
|
*
|
|
* @param IlluminateAuthEventsLogin $event
|
|
* @return void
|
|
*/
|
|
public function handle(Login $event)
|
|
{
|
|
session(['lang' => User::loggedIn()->language]);
|
|
session()->save();
|
|
}
|
|
}
|