update v1.0.6
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Cache;
|
||||
use Closure;
|
||||
@@ -11,14 +13,14 @@ use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class LanguageMiddleware implements Middleware {
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
||||
public function handle($request, Closure $next) {
|
||||
if (Cache::has('language') AND array_key_exists(Cache::get('language'), Config::get('languages'))) {
|
||||
App::setLocale(Cache::get('language'));
|
||||
}
|
||||
else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
||||
} else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
||||
App::setLocale(Config::get('app.fallback_locale'));
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user