mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-23 20:10:52 +00:00
Bruno Fontes
82a8bcb7a2
I was using "\App::setLocale" on code, but it was annoind me. So I included the "use App" and now I am colling directly the "App::setLocale".
23 lines
376 B
PHP
23 lines
376 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use App;
|
|
use Closure;
|
|
|
|
class Locale
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
App::setLocale(session('lang'));
|
|
return $next($request);
|
|
}
|
|
}
|