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
bump
please anyone knows how to fix this ?
Thank you
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.Hi @Dennis Koch
Please let me know where do I include the tenant? the exports table doesn't have the tenent id
I have never done this, so I don't know the exact instructions. I am just guessing at what it needed.
Ok thanks
Anyone who can help me with this please?
bump
bump
I guess nobody has solved this exact issue, so you won't get a tutorial for it.
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.
You can create a feature request on GitHub discussion, but seems like there is not much need for it right now.
I see, thank you so much.