Add language switch functionality: Implemented a new route for switching languages, allowing users to change the application language dynamically. Introduced a language selector component in the navbar for improved user experience, ensuring proper localization support. Updated the switch_language helper function to streamline locale management.

This commit is contained in:
Ümit Tunç
2025-11-04 15:28:24 -03:00
parent 7da35f79bb
commit 45534be05e
3 changed files with 51 additions and 4 deletions
+1 -4
View File
@@ -181,10 +181,7 @@ if (!function_exists('switch_language')) {
}
app()->setLocale($languageCode);
if (auth()->check()) {
session(['locale' => $languageCode]);
}
session(['locale' => $languageCode]);
return true;
}