Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Laravel 5.7 Mail Localization Improvements
Oct 04, 2018 @ 14:18:41

In this new post to the Larvel News site, they cover some of the recent improvements in the mail handling for the framework, specifically in the use of localization to tailor the content for a certain language.

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 IlluminateNotificationsNotification 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.

The post provides an example of how to use this functionality in sending your emails and how to add a "locale" field to your models. This allows you to set up a preferred default locale for the data, removing the need to reference it directly every time.

tagged: mail localization improvement laravel tutorial example

Link: https://laravel-news.com/mail-localization


Trending Topics: