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

cristian9509's avatar

User types, modules and requirements

I need to think a way to implement requirements that need to be meet based on different user types and also based on modules that users can purchase. Firstly, my user types may bring some requirements needed to complete their profile in order to give them access. But there are also the requirements that can be brought by modules and they need to be satisfied only if the user purchased that module. So therefore I have a users, requirements, user_types and modules table. I have then 3 junction tables module_user, requirement_user_type, and requirement_module. All my requirements stored in the requirements table have a function defined in the User model which checks if they are met. However when I check a user I only check for the requirements that are coming from their user_type and from the modules they have purchased (user_module -> module->requirement_module).

Note: in my case a requirement can be something like: personal address is required, business address is required, a license number is required, etc

Is there a more elegant way of handling this?

Imgur

0 likes
0 replies

Please or to participate in this conversation.