Skip to content

Commit

Permalink
Update user retrieval in LocalizationController
Browse files Browse the repository at this point in the history
Altered the user retrieval method in the LocalizationController. It previously used the request's user method directly, albeit it has been updated to employ \App\Models\User::find with the user id returned by the request's method to ensure the correct user is being updated. This will solve potential issues related to the user's locale not updating properly.
  • Loading branch information
Elshaden committed Dec 16, 2023
1 parent bc35af2 commit c11ce81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/LocalizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LocalizationController extends Controller

public function changeLanguage(Request $request)
{
$User = $request->user();
$User = \App\Models\User::find($request->user()->id);

$User->update( ['locale' => $request->language]);

Expand Down

0 comments on commit c11ce81

Please sign in to comment.