Multi-Tenancy database notifications

Hello, I have a multi-tenant project with some users having access to multiple tenants, we have an export function in one of our resources. When the user requests an export which is queued and sends database notifications when the export is completed. But it seems to be displaying same notification across all tenants for that logged in user. Please let me know how do I make it display notifications only at the tenant dashboard where it was requested from. Thank you so much.
9 Replies
mohdaftab
mohdaftabOP2w ago
bump please anyone knows how to fix this ? Thank you
Dennis Koch
Dennis Koch2w ago
It's all based on Laravel DB notifications. I think you'd need to: - Swap out the Notification class and overwrite ->toDatabase() to include the tenant - Overwrite ->notifications() relation on user model to query for the tenant.
mohdaftab
mohdaftabOP2w ago
Hi @Dennis Koch Please let me know where do I include the tenant? the exports table doesn't have the tenent id
Dennis Koch
Dennis Koch2w ago
I have never done this, so I don't know the exact instructions. I am just guessing at what it needed.
mohdaftab
mohdaftabOP7d ago
Ok thanks Anyone who can help me with this please? bump bump
Dennis Koch
Dennis Koch7d ago
I guess nobody has solved this exact issue, so you won't get a tutorial for it.
mohdaftab
mohdaftabOP7d ago
That is really sad, I think it is an important thing to add as an option to display notifications for the tenants where they requested it from. Thank you so much.
Dennis Koch
Dennis Koch7d ago
You can create a feature request on GitHub discussion, but seems like there is not much need for it right now.
mohdaftab
mohdaftabOP7d ago
I see, thank you so much.

Did you find this page helpful?