Seiten · Laravilt
Locale & Timezone
Let users choose their language and timezone.
->localeTimezone() adds a Locale & timezone page (Laravilt\Auth\Pages\LocaleTimezone) to the Settings cluster, at /{panel}/settings/locale-timezone.
php
The page saves two columns on users, which the auth migrations add:
| Field | Rules |
|---|---|
locale | required, string, max:10 |
timezone | required, a valid timezone identifier |
Available languages
The language list comes from config('app.available_locales'), which defaults to English and Arabic. Define your own in config/app.php:
php
dir tells the panel whether to use a right-to-left layout for that language.
Quick switching
Every panel also exposes POST /{panel}/locale for a quick language switcher.
In code
php