update v1.0.6

This commit is contained in:
sujitprasad
2016-02-16 22:42:08 +05:30
parent e6b579d67b
commit 073a49a8af
587 changed files with 21487 additions and 22766 deletions

View File

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