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

webrobert's avatar

Activity log best practice, relevant relations

I have many models that record activity. In the activity feed I want to provide context related to the action. Lazy loading is an issue because the different models have different relations so loading them up in the query doesn't work like with(['subject.replyable', ... ])

Do I just store the relevant context in the activity table in my column for changes, etc data so its with item, or is there another way to get the relevant relations for each model in the query?

0 likes
1 reply

Please or to participate in this conversation.