Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in v6.9.2 when creating model with an empty translations array. #476

Open
gehrisandro opened this issue Dec 18, 2024 · 1 comment

Comments

@gehrisandro
Copy link

Hi Spatie team

Since v6.9.2 we experience a breaking change when creating a model with an empty translations array.

For example this code:

Person::create([
    'name' => [],
]);

Before v6.9.2 it was stored in the database as:

[]

In v6.9.2 and above it is stored like this:

{"de": []}

The change was introduced here: #469

This change is something we could work around in our application. But before I adjust our code, I wonder what your opinions are?
Is this the expected new behaviour, or something you would also consider as an unexpected change?

@alipadron
Copy link
Contributor

@gehrisandro I am the author of the PR you mention.

I am sorry to know that the change affected you, i will try to find a way to be consistent with your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants