You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add overwrite option to model_translate helper and LocaleModel trait
This commit adds the ability to overwrite specific attributes when creating a new translation row using the `model_translate` helper and `LocaleModel` trait.
Key changes:
- `model_translate` helper: Accepts an optional `$options` array (4th argument) and passes it to `ModelTranslateJob`.
- `ModelTranslateJob`: Accepts `$options` in constructor and merges them with defaults before calling `translateTo`.
- `LocaleModel` trait: The `translateTo` method now checks for an `overwrites` key in `$options`. If present, these values are filled into the new model instance before saving.
- Added unit tests in `LocaleModelTest` to verify the new functionality.
Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com>
0 commit comments