Consistency in name fields #1234
Replies: 1 comment 1 reply
-
I've also noticed the different approaches. I also think it makes sense to take a uniform approach. In my project, I converted the But with regard to uniformity, the requirement of internationalization and to take the advantages of Lunar attributes into account, it makes the most sense to map everything that needs to be translated as Lunar attributes and not as model attributes / database fields. In this regard, it also makes sense to move the Ultimately, another term like “Fields” instead of “Attributes” seems useful to me. The term "Fields" is already partly used in connection with the Lunar attributes and would avoid misunderstandings and naming conflicts with the model attributes. When using JSON fields, I noticed that PHP and MySQL serialize and deserialize JSON data differently. In conjunction with Laravel, this leads to a bug that has not yet been fixed, which always defines models as "changed", which is sometimes problematic. The error is reported here, for example: laravel/framework#46247 One solution from Laravel would be to emulate JSON serialization depending on the database driver or to do without JSON fields, which would actually be a shame. |
Beta Was this translation helpful? Give feedback.
-
Currently, Brand and Customer models have specific name fields, which are sometimes translatable fields.
However, Products and Collections have their names specified within the custom attributes. Ideally, we would make this more consistent so that Products and Collections have a specific
name
field in the database. This would allow the system to rely upon the name fields more, as currently a developer could remove these attributes and cause errors in the system.Beta Was this translation helpful? Give feedback.
All reactions