Skip to content

Commit

Permalink
fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
asalout committed Dec 21, 2021
1 parent c401efc commit bbf1a98
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ class FieldServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'nova-language-tool');
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'nova-language-tool');

$lang = request('lang', request()->header('lang'));

if ($lang) app()->setLocale($lang);
if ($lang) {
app()->setLocale($lang);
}

Nova::serving(function (ServingNova $event) {
Nova::provideToScript(['locals' => $this->getSupportLocales(), 'currentLocal' => App::getLocale()]);
Expand All @@ -48,7 +50,7 @@ public function boot()
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/multilingual.php', 'multilingual');
$this->mergeConfigFrom(__DIR__ . '/../config/multilingual.php', 'multilingual');
}

protected function routes()
Expand All @@ -59,7 +61,7 @@ protected function routes()

Route::middleware(['nova', Authorize::class])
->prefix('nova-vendor/multilingual-nova')
->group(__DIR__.'/../routes/api.php');
->group(__DIR__ . '/../routes/api.php');
}


Expand Down

0 comments on commit bbf1a98

Please sign in to comment.