Last time we covered Laravel I18n Frontend Best Practices. Here,... read more
This article continues the "Phoenix I18n" series. Today you will learn how to craft a custom module plug that allows to set and persist the chosen locale. The final solution is going to take into consideration values from both GET param, cookie and HTTP header, thus being quite flexible.
Last time we covered Laravel I18n Frontend Best Practices. Here, we continue this best practice approach to I18n in Laravel, this time focusing on the data and model layers of a Laravel app. I won't assume you've read the previous article here, but it will help a bit if you have. I will assume you have the basics of Laravel down and that you're familiar with its Eloquent ORM. Let's get going.
Note: At time of writing, I'm using PHP 7.1, Laravel 5.5, and MySQL 5.6.