Skip to content

Commit

Permalink
fix language setting only available in view (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
dairidong authored Feb 23, 2023
1 parent cd4b522 commit cefe07d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function boot()
ProcessApps::dispatch();
}

$lang = Setting::fetch('language');
\App::setLocale($lang);

// User specific settings need to go here as session isn't available at this point in the app
view()->composer('*', function ($view) {
if (isset($_SERVER['HTTP_AUTHORIZATION']) && ! empty($_SERVER['HTTP_AUTHORIZATION'])) {
Expand Down Expand Up @@ -77,9 +80,6 @@ public function boot()
$allusers = User::all();
$current_user = User::currentUser();

$lang = Setting::fetch('language');
\App::setLocale($lang);

$view->with('alt_bg', $alt_bg);
$view->with('allusers', $allusers);
$view->with('current_user', $current_user);
Expand Down

0 comments on commit cefe07d

Please sign in to comment.