Describe the bug
I am trying to restore a model. MyModel::withTrashed()->find(id)->restore().
The saveTransactions method gets called with a translation object for the current locale, with empty attributes. It then tries to insert that into the table, failing.
To Reproduce
class MyModel extends Model implements TranslatableContract
{
use Translatable;
public $translatedAttributes = ['name', 'web_name'];
}
Expected behavior
I would expect the restore event to be correctly handled. It is probably handled in the same manner as saved/created events.
Versions (please complete the following information)
- PHP: 8.1
- Database: mysql
- Laravel: 10.16
- Package: 11.12