Voyager was built with multi-language support in mind. Translatable fields will be stored as JSON in your database.
In order to query (search) for translated values, Voyager uses the JSON SQL syntax and therefore needs real JSON columns to function properly.
The first parameter is the field you want to access, the second the locale you want to get the value in, the third the fallback locale if a translation does not exist in the wanted locale and the firth parameter is the value which will be returned when none of the locales exist.
Setting translated values
The current locale of a property can be set as normal:
Sometimes it is useful to not automatically translate properties when accessing them. This can be done by calling dontTranslate() on your model. To re-activate automatic translations, call translate(). After calling dontTranslate() you will get an array containing locale => value pairs, for example: