mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Check for DB table
This commit is contained in:
parent
1a14abed05
commit
9a8e4a55e7
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue