Skip to content

Fix not_found exception translation adding #227

@DenTray

Description

@DenTray

Description

What is the issue?

When the validation.exceptions.not_found translation is removed and an entity is generated (e.g., by running php artisan make:entity Blank ), the lang/en/validation.php file becomes broken. This happens because a duplicated exceptions key is added instead of adding the not_found key inside the existing exceptions key.

Expected Behavior

What should happen instead?

The new not_found key should be added inside the existing exceptions key of the lang/en/validation.php file without duplicating the exceptions key.

Steps to Reproduce

How can we replicate the issue?

1. Remove the validation.exceptions.not_found translation.
2. Run entity generation, for example: php artisan make:entity Blank .

Impact

What is the impact of the bug?

The lang/en/validation.php file becomes broken due to duplicated exceptions keys, which likely causes errors or incorrect behavior in translations.

Solution


The solution should use winter/laravel-config-writer to check if the translation does not exist, and then add it properly inside the existing exceptions key only if it is missing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions