ok
Direktori : /home2/selectio/public_html/bharath/a1tex.in/app/Http/Middleware/ |
Current File : /home2/selectio/public_html/bharath/a1tex.in/app/Http/Middleware/APILocalizationMiddleware.php |
<?php namespace App\Http\Middleware; use App\CPU\Helpers; use Closure; use Illuminate\Support\Facades\App; class APILocalizationMiddleware { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $local = ($request->hasHeader('lang')) ? (strlen($request->header('lang')) > 0 ? $request->header('lang') : Helpers::default_lang()) : Helpers::default_lang(); App::setLocale($local); return $next($request); } }