shareit/app/Http/Middleware/Locale.php
Bruno Fontes 8157a183c7
Refactoring: just including "use App" to make code a bit cleaner
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".
2018-10-02 23:49:16 -03:00

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);
}
}