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

jimmy0699's avatar

how to name polimorphic table

how to name polimorphic table with info about user have see/read things ? like message, notifcation, article etc...

0 likes
3 replies
AdrianHernandezLopez's avatar

Hi @jimmy0699

What about user_has_seen? user_id, model, model_id ... Something that give enough meaning just reading the table.

Hope this helps.

Regards, Adrian

1 like
martinbean's avatar

@jimmy0699 You could go with something like user_content_views with the following columns:

  • user_id
  • content_id
  • content_type

And then use the created_at column to determine when they read/saw the message, notification, article etc.

1 like

Please or to participate in this conversation.