Changelog
Last updated
Was this helpful?
Last updated
Was this helpful?
Change \Astrotomic\Translatable\Traits\Relationship::translation()
relation to use the new ofMany
-
Drop PHP7 support
Drop Laravel 5.8 and 6 and 7 support
Add Laravel 9 support
Add PHP8.1 support
Fix all methods visibility to allow customization -
Add Laravel 8 support -
Fix \Astrotomic\Translatable\Exception\LocalesNotDefinedException
exception message
Drop PHP 7.1 support
Drop Laravel 5.6 & 5.7 support
Add \Astrotomic\Translatable\Contracts\Translatable
interface
Split \Astrotomic\Translatable\Translatable
into multiple traits - but use them in the main one
Flag methods, not defined in interface as @internal
Rename getRelationKey()
to getTranslationRelationKey()
to prevent conflicts - the original one is @deprecated
and will be dropped in next major release
migrate from dimsav to astrotomic
upgrade to dimsav/laravel-translatable:v10.0.0
run composer remove dimsav/laravel-translatable
run composer require astrotomic/laravel-translatable
replace Dimsav\
by Astrotomic\
in your whole project (namespace change)
Added compatibility with Laravel v5.4.
Translated fillable properties should only be defined in the translation model.
To update from version 5, move all the fillable properties belonging to a translation to the corresponding translation models.
Added deleteTranslations()
method for conveniently deleting translations
Fixed a bug in locale fallback on toArray()
Added Laravel 5.2 support
Dropped Laravel 5.0 support
Added new scope withTranslation()]
to decrease the number of mysql calls made.
Fixed db in tests is dropped and recreated to make tests more stable
Added documentation in readme file
Applied PSR-2 code style.
Laravel 5 ready
Added configuration option for returning fallback translations
Added scope to list translated attributes in the current locale.
Drops support for laravel 4.0.
Compatible with laravel 4.1 and laravel 4.2.
External config file.
Fallback issue fixed.
Added translated and translatedIn scopes.
Changed behavior: getting non existing translations with getTranslation()
used to return objects, now null
is returned.
Translated attributes now shown when converting toArray()
or toJson()
.
Fixed bug: fill()
created empty translations even when translated attributes were not fillable.
Added option to make translated attributes always fillable.
Fallback translation is not returned if it is not defined.
Fallback locale now is taken from app.fallback_locale
config key.
Fixed issue with saving translations, caused by the update of the laravel core.
Added travis environment for laravel 4.2.
Translatable is now a trait and can be used as add-on to your models.
100% code coverage
Initial version
Translatable is a class extending Eloquent
96% code coverage
Fix custom locale column name in \Astrotomic\Translatable\Traits\Relationship::translation()
method -
Add Laravel 7 support -
Add .gitattributes
to exclude files from archive -
Add translateOrFail()
method -
Fix PHP translation cascade deletion -
Add PHP side translation cascade deletion - (disabled by default)
Fix scope orderByTranslation()
to return all translations -
Fix getTranslationByLocaleKey()
to use translation
relation if possible -
Add rule parsing to \Astrotomic\Translatable\Validation\RuleFactory
-
Add Laravel 6 support -
Add \Astrotomic\Translatable\Validation\RuleFactory
-
Fix duplicate checks of same locale -
Add auto fallback locale finder -
Fix conflict between attributes and locales during fill()
-
Refactor translation
relationship -
Add missing return type-hints -
Add missing dependencies illuminate/contracts
and illuminate/database
-
Add translation
relationship -
Update the where translation scopes to unify them and remove duplicated code -
Add PHP7 type-hints
Move to Astrotomic
&
Add Dimsav\Translatable\Locales
helper class
Fix getRelationKey()
drop custom save method in favor of saved event listener
Add isEmptyTranslatableAttribute()
method to allow custom empty attribute decision logic
Add Laravel 5.8 support &
Fix n+1 queries when updating non-translated model attributes
Add support for Laravel 5.7
Do not call get translation with fallback locale and fallback enabled
Allow translateOrDefault()
and translateOrNew()
to default to user app locale
Change autoload translations behavior on runtime
Use fallback in attributesToArray()
Added orderByTranslation()
scope
Example in doc for locale filtering in whereTranslation()
scope
Fire saving event in every case
Allow to change default translation model namespace from config file
Added support for Laravel 5.6
Fixed error when fallback not available.
Fixed withTranslation query scope performance
Fixed fallback for country-based locales
Fixed empty attribute values
Added support for Laravel 5.5
Added compatibility with custom db connections.
Fixed delete events not fired for translations.
Added replicateWithTranslations()
.
Added orWhereTranslation()
and orWhereTranslationLike()
scopes.
Added support for laravel auto-discovery.
Added tag for publishing the config file.
Added fallback per attribute.
Added getTranslationsArray()
Fixed filling 'property:locale' format was not validating the locale.
Added default locale per model.
Filling a model now supports using the 'property:locale' format in keys. For example: $country->fill(['name:en' => 'Belgium'])
Added config to skip translations in toArray()
for better performance when needed.
Fix issue when trying to fetch a translation with a country based locale
Added support for Lumen without Facades
Added support for Model accessors
Updated code style and added to enforce it
Added scope notTranslatedIn()
Added scope whereTranslationLike()
Fire 'updated' event when saving translations.
setAttribute()
returns the model itself, which is now the default in eloquent.
Added compatibility with custom primary key
Added whereTranslation()
scope
Added option to override default locale
Added default value in translatedIn()
scope
Added about scopes.
Fixed bug when using syntax $country->{'name:en'}
and locale doesn't exist
Method isTranslationAttribute() is now public
Fixed compatibility with Lumen
Fixed making an attribute on a translatable model hidden does not hide it
Added mutator/accessor translations using the format $country->{'name:de'}
thanks to
Force fire "saved" event when the original model is not saved, but the translation is
The Translation
class suffix default can be overridden in the app config. See
The app.fallback_locale
setting can be overridden in each model separately. See
Added fallback to default locale if translations is missing.
Removed syntax $model->en->name
because conflicts may happen if the model has a property named en
. See .
Added method hasTranslation($locale)
. See .
Fixed bug . Model's Translations were deleted when the model delete failed.