thomasjohnkane / snooze

A package to simplify automating future notifications and reminders in Laravel
MIT License
867 stars 89 forks source link

Multi-Tenancy #106

Open zinct opened 1 year ago

zinct commented 1 year ago

Hello, first of all thank you so much for creating this package.. How do I implement multitenancy into this package?

I am currently creating an application that uses the multitenancy feature with the archtechx/tenancy package. I have already created a duplicate of the scheduled_notifications table in the tenant database, but I am unable to perform the php artisan snooze:send command because this actions will trigger to the central database while the notification data is located in the tenant database.

chatisk commented 1 year ago

@zinct did you try to run the command as following?

php artisan tenants:run snooze:send --tenants=your-tenant ?

yashiroiori commented 8 months ago

@zinct did you try to run the command as following?

php artisan tenants:run snooze:send --tenants=your-tenant ?

How to send in Central App?? Use into model connection name, but say No hint path defined for [connectioName]

atymic commented 8 months ago

I don't use this package, but feel free to PR if you can figure out the way to solve this.

yashiroiori commented 8 months ago

I don't use this package, but feel free to PR if you can figure out the way to solve this.

I understand, It's possible set custom connection when create notification?? Default connection use "mysql"

atymic commented 8 months ago

Hmm, could you link to your docs on the tenancy package? Ideally we could find a way that works with most/all tenancy packages.

yashiroiori commented 7 months ago

Hmm, could you link to your docs on the tenancy package? Ideally we could find a way that works with most/all tenancy packages.

Into table jobs snooze save connection name, into the package have 2 connections, the first are central connection named mysql or system is use by the central system is how works that and snooze works fine with notifications created into central app, the second connection named tenant the package detect that name use a database of tenant but snooze set name connection mysql don't work with tenants, may fixed it's the posibility to pass a name connection when create a notification with snooze

https://tenancyforlaravel.com/docs/v3/introduction/

chatisk commented 7 months ago

I don't know your situation. But if you are using the stancl multitenanxmcy package, then all you have to do is to add a trait called CentralConnection to the model you want to save. That way it will connect to the central db. Not the tenant's

yashiroiori commented 7 months ago

I don't know your situation. But if you are using the stancl multitenanxmcy package, then all you have to do is to add a trait called CentralConnection to the model you want to save. That way it will connect to the central db. Not the tenant's

But how snooze search data whe the notification are tenant model like custoner, the central app y tenant have Customers