That sounds to me like a very bad database design. These kinds of values should have their own columns in a dedicated table.
- postcode
- number
- birthday
I have a database structure such that a table account has properties in a table called accountPropertyValue. accountPropertyValue has an accountId column, a propertyId column (this relates to each property available, such as postcode, number, birthday etc.) and valueText, valueInteger and valueDate columns as well as a dataType column to know which valueX column to use.
Is there a nice way to build this relationship into Eloquent such that each property with propertyId x has it's own one-to-one relationship with account. Most is achievable by extending the hasOne class and creating a lot of custom rules but it would be nice to have this working more neatly. Thanks
Please or to participate in this conversation.