Skip to content

Commit

Permalink
Improve the App\Providers\AppServiceProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyCyborg committed Nov 24, 2019
1 parent 857ab5a commit f7198e3
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
$session = $this->app['session'];

if (! $session->has('language')) {
$cookie = $this->app['request']->cookie(PREFIX .'language', null);

$locale = $cookie ?: $this->app['config']->get('app.locale');

$session->set('language', $locale);
} else {
$locale = $session->get('language');
}

$this->app['language']->setLocale($locale);
//
}

/**
Expand Down

0 comments on commit f7198e3

Please sign in to comment.