FilamentF
Filament14mo ago
ericmp

Filament ResetPassword notification - set locale correctly

i do:
app()->setLocale('ca');

$user = User::query()->where('email', 'test@test.test')->first();

$token = \Illuminate\Support\Facades\Password::getRepository()->create($user);

$notification = new \Filament\Notifications\Auth\ResetPassword($token);
$notification->url = \Filament\Facades\Filament::getResetPasswordUrl($token, $user);

$user->notify($notification);


the email i get is in english. why? im setting the app locale in catalan before sending the notification. why is sent in english?

then i saw that in my env i have:
APP_LOCALE=en

and if i change the env to:
APP_LOCALE=ca


and i get the email in catalan.
but i dont want to change the APP_LOCALE

i want the notification to be sent in the language i set before the notification is sent. how to achieve it? i thought doing app()->setLocale('ca') would do the trick, but seems is being ignored
Was this page helpful?