Applied fixes from StyleCI

This commit is contained in:
Sujit Prasad
2016-02-19 02:20:12 -05:00
committed by StyleCI Bot
parent be5df5334f
commit d637c2b23f
439 changed files with 19063 additions and 19210 deletions

View File

@@ -5,22 +5,19 @@ namespace App\Http\Middleware;
use Cache;
use Closure;
use Illuminate\Contracts\Routing\Middleware;
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Session;
class LanguageMiddleware implements Middleware {
public function handle($request, Closure $next) {
if (Cache::has('language') AND array_key_exists(Cache::get('language'), Config::get('languages'))) {
class LanguageMiddleware implements Middleware
{
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
App::setLocale(Config::get('app.fallback_locale'));
}
return $next($request);
}
}