Answer the question
In order to leave comments, you need to log in
How to properly store an array of user settings?
Hello.
Initial data:
There is an online store on Laravel (but this, in theory, is not important). And each user has settings in their personal account. There may be several levels of nesting. Settings are needed for the user notification system.
They need to be stored and be able to work effectively with them. For example, it should be possible to quickly get all users who have an alert selected.
I made tables settings (name, id_parent) and setting_user (user_id, setting_id, value).
I can't explain why, but I don't like this option. Create two tables for some unfortunate settings?
Maybe just add a field with the json type to users and store all the settings there? But how then to make selections by settings with different conditions?
In general, I ask you for ideas for implementing efficient storage and use of these settings.
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question