Astrotomic / laravel-translatable

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

translation relation does not work with uuid keys in postgres DB #361

Closed applyACS closed 11 months ago

applyACS commented 11 months ago

version 11.12

translation relation does not work with uuid keys because of max

```

public function translation(): HasOne { return $this ->hasOne($this->getTranslationModelName(), $this->getTranslationRelationKey()) ->ofMany([ $this->getTranslationRelationKey() => 'max', ], function (Builder $query): void { $query->where($this->getLocaleKey(), $this->localeOrFallback()); }); }


uuid is not sortable in postgresql

Can you maybe rollback to the previous code?

public function translation(): HasOne { return $this ->hasOne($this->getTranslationModelName(), $this->getTranslationRelationKey()) ->where($this->getLocaleKey(), $this->localeOrFallback()); }



This worked just fine
Gummibeer commented 11 months ago

360