- Change
\Astrotomic\Translatable\Traits\Relationship::translation()
relation to use the newofMany
- #297
- 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 - #198
- Add Laravel 8 support - #180
- Fix
\Astrotomic\Translatable\Exception\LocalesNotDefinedException
exception message
- Fix custom locale column name in
\Astrotomic\Translatable\Traits\Relationship::translation()
method - #146
- Add Laravel 7 support - #128
- Add
.gitattributes
to exclude files from archive - #126
- Add
translateOrFail()
method - #114
- Fix PHP translation cascade deletion - #105
- Drop PHP 7.1 support
- Drop Laravel 5.6 & 5.7 support
- Add PHP side translation cascade deletion - #98 (disabled by default)
- Fix scope
orderByTranslation()
to return all translations - #72
- Fix
getTranslationByLocaleKey()
to usetranslation
relation if possible - #49
- Add rule parsing to
\Astrotomic\Translatable\Validation\RuleFactory
- #56
- Add Laravel 6 support - #52
- Add
\Astrotomic\Translatable\Validation\RuleFactory
- #34
- Fix duplicate checks of same locale - #40
- Add auto fallback locale finder - #36
- Fix conflict between attributes and locales during
fill()
- #38
- Refactor
translation
relationship - #23
- Add missing return type-hints - #16
- Add missing dependencies
illuminate/contracts
andilluminate/database
- #9 - Add
\Astrotomic\Translatable\Contracts\Translatable
interface - Split
\Astrotomic\Translatable\Translatable
into multiple traits - but use them in the main one - Add
translation
relationship - #3 - Flag methods, not defined in interface as
@internal
- Rename
getRelationKey()
togetTranslationRelationKey()
to prevent conflicts - the original one is@deprecated
and will be dropped in next major release - Update the where translation scopes to unify them and remove duplicated code - #2
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\
byAstrotomic\
in your whole project (namespace change)
- Add
Dimsav\Translatable\Locales
helper class #574 - Fix
getRelationKey()
#575 - drop custom save method in favor of saved event listener #567
- Add
isEmptyTranslatableAttribute()
method to allow custom empty attribute decision logic #576
- Fix n+1 queries when updating non-translated model attributes #533
- Add support for Laravel 5.7 #518
- Do not call get translation with fallback locale and fallback enabled #502
- Allow
translateOrDefault()
andtranslateOrNew()
to default to user app locale #500 - Change autoload translations behavior on runtime #501
- Use fallback in
attributesToArray()
#503 - Added
orderByTranslation()
scope #504 - Example in doc for locale filtering in
whereTranslation()
scope #487 - Fire saving event in every case #457
- Allow to change default translation model namespace from config file #508
- Added support for Laravel 5.6 #435
- Fixed error when fallback not available. #422
- Fixed withTranslation query scope performance #417
- Fixed fallback for country-based locales #417
- Fixed empty attribute values #410
- Added support for Laravel 5.5 #394
- Added compatibility with custom db connections. #366
- Fixed delete events not fired for translations. #361
- Added
replicateWithTranslations()
. #346 - Added
orWhereTranslation()
andorWhereTranslationLike()
scopes. #338 - Added support for laravel auto-discovery. #359
- Added tag for publishing the config file. #360
- Added fallback per attribute. #348
- Added
getTranslationsArray()
#347 - Fixed filling 'property:locale' format was not validating the locale. #356
- Added compatibility with Laravel v5.4.
- Added default locale per model. #271
- Filling a model now supports using the 'property:locale' format in keys. #314 For example:
$country->fill(['name:en' => 'Belgium'])
- Added config to skip translations in
toArray()
for better performance when needed. #315
- Fix issue when trying to fetch a translation with a country based locale #264
- 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
- Added support for Lumen without Facades #259
- Added support for Model accessors #257
- Updated code style and added styleci to enforce it
- Added scope
notTranslatedIn()
#235
- Fixed a bug in locale fallback on
toArray()
- Added Laravel 5.2 support
- Dropped Laravel 5.0 support
- Added scope
whereTranslationLike()
#183 - Fire 'updated' event when saving translations. #190
setAttribute()
returns the model itself, which is now the default in eloquent. #201
- Added compatibility with custom primary key #174
- Added
whereTranslation()
scope #168
- Added option to override default locale #158
- Added default value in
translatedIn()
scope #148 - Added new scope
withTranslation()]
to decrease the number of mysql calls made. - Added documentation about scopes.
- Fixed db in tests is dropped and recreated to make tests more stable
- Fixed bug when using syntax
$country->{'name:en'}
and locale doesn't exist #150 - Method isTranslationAttribute() is now public #151
- Fixed compatibility with Lumen #121
- Fixed making an attribute on a translatable model hidden does not hide it #133
- Added mutator/accessor translations using the format
$country->{'name:de'}
thanks to @barryvdh - 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.
- Force fire "saved" event when the original model is not saved, but the translation is #85
- 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, nownull
is returned. - Translated attributes now shown when converting
toArray()
ortoJson()
. - Fixed bug:
fill()
created empty translations even when translated attributes were not fillable. - Added option to make translated attributes always fillable.
- The
Translation
class suffix default can be overridden in the app config. See 7ecc0a75d - The
app.fallback_locale
setting can be overridden in each model separately. See #33 - 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 fallback to default locale if translations is missing. #23
- Added travis environment for laravel 4.2.
- Removed syntax
$model->en->name
because conflicts may happen if the model has a property nameden
. See #18. - Added method
hasTranslation($locale)
. See #19.
- Fixed bug #7. Model's Translations were deleted when the model delete failed.
- 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