Skip to content

Commit

Permalink
Update user locale adjustments in NovaLocalizationServiceProvider
Browse files Browse the repository at this point in the history
Replaced auth()->user() method with a direct model call in NovaLocalizationServiceProvider. This change ensures that the user's locale is properly updated in the application even when the user is authenticated.
  • Loading branch information
Elshaden committed Dec 16, 2023
1 parent bcc0764 commit d5396aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NovaLocalizationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function bootingPackage()
$event->request->setLocale($Locale);
}else{
if(auth()->check()) {
auth()->user()->update(['locale' => app()->getLocale()]);
\App\Models\User::find(auth()->id())->update(['locale' => app()->getLocale()]);
}
}
if (app()->getLocale() == 'ar') {
Expand Down

0 comments on commit d5396aa

Please sign in to comment.