rinvex / laravel-attributes

⚠️ [ABANDONED] Rinvex Attributable is a robust, intelligent, and integrated Entity-Attribute-Value model (EAV) implementation for Laravel Eloquent, with powerful underlying for managing entity attributes implicitly as relations with ease. It utilizes the power of Laravel Eloquent, with smooth and seamless integration.
MIT License
433 stars 104 forks source link

Translations for Value content #157

Closed pcfjojo closed 3 years ago

pcfjojo commented 3 years ago

Value field content Is it possible to add HasTranslations for Value model?

Example: $category = Category::first(); $category->size = array( "it" => "Grosso", "en" => "Big" ); $category->save();

something like this?

Omranic commented 3 years ago

Thank you @pcfjojo for the proposal, yes you can do that by overriding the Value model and utilize the trait, but I believe we'll need to make it easier to override the model from config options like other models, so it's just one change to the core package, and you can use your custom model https://github.com/rinvex/laravel-attributes/blob/master/config/config.php#L24-L29

I'd be happy to consider PRs..