mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-28 05:41:27 +00:00
35 lines
609 B
PHP
35 lines
609 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Listeners;
|
||
|
|
||
|
use App\User;
|
||
|
use IlluminateAuthEventsLogin;
|
||
|
use Illuminate\Queue\InteractsWithQueue;
|
||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
|
use Illuminate\Auth\Events\Login;
|
||
|
|
||
|
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();
|
||
|
}
|
||
|
}
|