Check for DB table

This commit is contained in:
snipe 2016-05-14 15:05:28 -07:00
parent 1a14abed05
commit 9a8e4a55e7

View file

@ -5,6 +5,7 @@ namespace App\Http\Middleware;
use Closure;
use Config;
use Route;
use Schema;
use App\Models\Setting;
class CheckLocale
@ -20,7 +21,7 @@ class CheckLocale
public function handle($request, Closure $next, $guard = null)
{
if (Schema::hasTable('settings')) {
// User's preference
if (($request->user()) && ($request->user()->locale)) {
\App::setLocale($request->user()->locale);
@ -33,6 +34,9 @@ class CheckLocale
} else {
\App::setLocale(config('app.locale'));
}
}
\App::setLocale(config('app.locale'));
return $next($request);
}
}