Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jack_rsantana's avatar

How to save and load data from select type elements that do not have the saved description in the database

Good night people! Could anyone please tell me, what would be the best practice for saving and loading data from select type elements that do not have the description saved in the database?

I am currently saving only the id of the selected option and at the time of displaying, I created a translation file that generates the description from the id. But I guess that's not the best way. I did this because I did not know better. And besides, since I use AngularJS to display the values on the screen, I can not integrate it with the blade.

These are fixed fields, where the user can not enter new values. Example: Type of person (Physical or Legal), Type of contact (email, telephone or fax). In these cases, I save only a number that represents that description, rather than saving the entire description.

Would anyone have a better suggestion? Thank you in advance.

0 likes
0 replies

Please or to participate in this conversation.