Astrotomic / laravel-translatable

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

Fix new translation is missing the relation id for saving #418

Closed Tofandel closed 1 month ago

Tofandel commented 1 month ago

If we do

$tr = $model->translateOrNew('en');
$tr->some_field = 'abc';
$tr->save();

We get a query exception (Field ..._id doesn't have a default value) because the package is not setting the relation key

This PR fixes the issue

Gummibeer commented 1 month ago

https://github.com/Astrotomic/laravel-translatable/releases/tag/v11.14.1