Laravel 5.7 Mail Localization Improvements

Laravel 5.7 Mail Localization Improvements

Laravel 5.7.7 is now released and includes both bug fixes and thanks to Derek MacDonald a big improvement to Mail Localization. With the release of Laravel 5.7 the Illuminate\Notifications\Notification class started offering a locale method to set the desired language. The application will change into this locale when the notification is being formatted and then revert back to the previous locale when formatting is complete. Here is an example of this feature:

use Illuminate\Contracts\Translation\HasLocalePreference; class User extends Model implements HasLocalePreference { public function preferredLocale() { return $this->locale; } }

0 Comments

Leave a reply

your email address will not be published. required fields are marked *

Categores Themes

Featured Themes