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.
11 Replies
mohdaftab
mohdaftabOP3mo ago
bump please anyone knows how to fix this ? Thank you
Dennis Koch
Dennis Koch2mo 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
mohdaftabOP2mo 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 Koch2mo ago
I have never done this, so I don't know the exact instructions. I am just guessing at what it needed.
mohdaftab
mohdaftabOP2mo ago
Ok thanks Anyone who can help me with this please? bump bump
Dennis Koch
Dennis Koch2mo ago
I guess nobody has solved this exact issue, so you won't get a tutorial for it.
mohdaftab
mohdaftabOP2mo 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 Koch2mo ago
You can create a feature request on GitHub discussion, but seems like there is not much need for it right now.
mohdaftab
mohdaftabOP2mo ago
I see, thank you so much.
kintronix
kintronix2mo ago
I am trying to figure this out right now as well
mohdaftab
mohdaftabOP2mo ago
@kintronix please let me know if you manage to make it work, thank you.

Did you find this page helpful?