updating user and language models
This commit is contained in:
@ -42,18 +42,18 @@ class HandleInertiaRequests extends Middleware
|
||||
*/
|
||||
public function share(Request $request): array
|
||||
{
|
||||
$localeFields = ['locale', 'iso_code', 'name', 'localized_name'];
|
||||
$localeFields = ['locale_name', 'iso_code', 'name', 'localized_name'];
|
||||
$currentLocale = $request->session()->get('locale', null);
|
||||
if (is_null($currentLocale)) {
|
||||
$currentLocale = Language::where(['locale' => 'en', 'iso_code' => 'en_US'])->get($localeFields)[0]->toArray();
|
||||
$currentLocale = Language::where(['locale_name' => 'en', 'iso_code' => 'en_US'])->get($localeFields)[0]->toArray();
|
||||
$request->session()->put('locale', [
|
||||
'locale' => $currentLocale['locale'],
|
||||
'locale_name' => $currentLocale['locale_name'],
|
||||
'iso_code' => $currentLocale['iso_code'],
|
||||
'name' => $currentLocale['name'],
|
||||
'localized_name' => $currentLocale['localized_name'],
|
||||
]);
|
||||
}
|
||||
$localeFilePath = base_path("lang/{$currentLocale['locale']}.json");
|
||||
$localeFilePath = base_path("lang/{$currentLocale['locale_name']}.json");
|
||||
|
||||
$notifications = [];
|
||||
$notificationsCount = count($notifications);
|
||||
|
Reference in New Issue
Block a user