mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 11:41:31 +00:00
updated streamline-setup v2
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Streamline\Http\Middleware;
|
||||
|
||||
use Closure, Session, Auth;
|
||||
|
||||
class LocaleMiddleware {
|
||||
|
||||
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if(Auth::user()){
|
||||
$personal_locale = 'en';
|
||||
if (Auth::user()->system_language == 1) {
|
||||
$personal_locale = 'en';
|
||||
} elseif(Auth::user()->system_language == 2){
|
||||
$personal_locale = 'pt';
|
||||
} elseif(Auth::user()->system_language == 3){
|
||||
$personal_locale = 'fr';
|
||||
}
|
||||
app()->setLocale($personal_locale);
|
||||
}elseif($locale = Session::has('locale')){
|
||||
app()->setLocale($locale);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user