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

Dimitrios's avatar

How to store Services and Services details for Client Portal

Hello community. I have a project for a client that need to store Services he sells (web hosting, domains, web design - but not limited to these) Currently I have a Services table and ServiceType table with relationship. I need to find an approach where I can store different data for each kind of service, without being limited.

First though was to create 3 tables, one for each service and join them with main service table. The issue on this one is that if client needs a different service, I will have to create new tables as well.

Second though was to use Meta tables and add all service data into service meta table. That will give me freedom of adding all kind of services, but I have to remember each time which meta data I used on each service. (Eg domain has name,expiry,code - web hosting has space,bandwidth,server) while I build my app. For example I may forgot to add a meta on a create form or forget to display it. Unless there is a way to make groups of meta and use them; like wordpress custom post types, where you can add a group of meta data on each object.

Any ideas are welcomed ;)

0 likes
2 replies
Snapey's avatar

you could use an EAV store (like magneto) assuming this meta data is rarely searched.

EAV table would have columns for

  • service_id
  • meta name
  • type
  • string
  • integer
  • date

then your metadata associated with the service can be stored as a sequence of small records

other data such as renewal date can be stored against the service so that things like upcoming renewals are easy to find

Dimitrios's avatar

Seems the second one is famous, as WordPress use it as well... Is there any trick to know which meta properties will be used by each service?

One thought is to make classes extending Service but new services will need extra classes

Please or to participate in this conversation.