astrotomic/laravel-translatable
Laravel package for translatable Eloquent models. Store model translations in the database and automatically fetch/save multilingual attributes based on locale, reducing boilerplate when working with multi-language content.
\Astrotomic\Translatable\Traits\Relationship::translation() relation to use the new ofMany - #297\Astrotomic\Translatable\Exception\LocalesNotDefinedException exception message\Astrotomic\Translatable\Traits\Relationship::translation() method - #146.gitattributes to exclude files from archive - #126translateOrFail() method - #114orderByTranslation() to return all translations - #72getTranslationByLocaleKey() to use translation relation if possible - #49\Astrotomic\Translatable\Validation\RuleFactory - #56\Astrotomic\Translatable\Validation\RuleFactory - #34fill() - #38translation relationship - #23illuminate/contracts and illuminate/database - #9\Astrotomic\Translatable\Contracts\Translatable interface\Astrotomic\Translatable\Translatable into multiple traits - but use them in the main onetranslation relationship - #3[@internal](https://github.com/internal)getRelationKey() to getTranslationRelationKey() to prevent conflicts - the original one is [@deprecated](https://github.com/deprecated) and will be dropped in next major releasemigrate from dimsav to astrotomic
dimsav/laravel-translatable:v10.0.0composer remove dimsav/laravel-translatablecomposer require astrotomic/laravel-translatableDimsav\ by Astrotomic\ in your whole project (namespace change)Dimsav\Translatable\Locales helper class #574getRelationKey() #575isEmptyTranslatableAttribute() method to allow custom empty attribute decision logic #576translateOrDefault() and translateOrNew() to default to user app locale #500attributesToArray() #503orderByTranslation() scope #504whereTranslation() scope #487replicateWithTranslations(). #346orWhereTranslation() and orWhereTranslationLike() scopes. #338getTranslationsArray() #347$country->fill(['name:en' => 'Belgium'])toArray() for better performance when needed. #315deleteTranslations() method for conveniently deleting translationsnotTranslatedIn() #235toArray()whereTranslationLike() #183setAttribute() returns the model itself, which is now the default in eloquent. #201whereTranslation() scope #168translatedIn() scope #148withTranslation()] to decrease the number of mysql calls made.$country->{'name:en'} and locale doesn't exist #150$country->{'name:de'} thanks to [@barryvdh](https://github.com/barryvdh)getTranslation() used to return objects, now null is returned.toArray() or toJson().fill() created empty translations even when translated attributes were not fillable.Translation class suffix default can be overridden in the app config. See 7ecc0a75dapp.fallback_locale setting can be overridden in each model separately. See #33app.fallback_locale config key.$model->en->name because conflicts may happen if the model has a property named en. See #18.hasTranslation($locale). See #19.How can I help you explore Laravel packages today?