Astrotomic / laravel-translatable

A Laravel package for multilingual models
https://docs.astrotomic.info/laravel-translatable/
MIT License
1.23k stars 155 forks source link

refactor `translation()` to `hasOne()->ofMany()` relationship #275

Closed Gummibeer closed 1 year ago

Gummibeer commented 2 years ago

The translation() should be refactored to the new hasOne()->ofMany() relationship type. https://laravel.com/docs/9.x/eloquent-relationships#has-one-of-many

https://github.com/Astrotomic/laravel-translatable/blob/6f2e3855836d46ab7ad3dabd269a400404f8b42c/src/Translatable/Traits/Relationship.php#L64-L69