F
Filament9mo ago
Niels

Attach users to tenant

This feels like a very simple thing, yet I can't figure it out. Users have a many-to-many relationship with tenants. Now, someone who already belongs to a tenant, should be able to attach his friends to it as well. I think it's possible with a multiple() select field in the site profile page, however I would like to do it via attach/detach buttons. I already have a UserResource with all the users belonging to the tenant, but attach buttons only seems to be working in relation managers, while this is just a resource. What are my options?
Solution:
This is something you should build yourself (invitations). Typically you create a new Invitation model with a tenant id, email and hash. You can also opt to be able to pre assign a tenant role. Another good practice is an expiration date. Set up a notification (email) and a public page that will be used to enter name(s) / password / etc. Check the hash on load and create and after user creation, redirect to the tenant. If the user’s email already exists on another tenant you could serve a ‘Accep...
Jump to solution
4 Replies
Niels
NielsOP9mo ago
Found a related post: https://www.answeroverflow.com/m/1142074355736649841 I want to be able to invite people to the tenant.
How do i add team members? - Filament
Hello there, i have a multi tenant filament admin panel. How do i add team members? i mean how do i invite a new team member to the team that i have created? thanks
Solution
Tim van Heugten
Tim van Heugten9mo ago
This is something you should build yourself (invitations). Typically you create a new Invitation model with a tenant id, email and hash. You can also opt to be able to pre assign a tenant role. Another good practice is an expiration date. Set up a notification (email) and a public page that will be used to enter name(s) / password / etc. Check the hash on load and create and after user creation, redirect to the tenant. If the user’s email already exists on another tenant you could serve a ‘Accept invitation’ variant and skip the password setting etc.
Niels
NielsOP9mo ago
Thank you for pointing me in the right direction 🙂
Niels
NielsOP9mo ago
GitHub
Filament-CRM-Course/course/14 - Inviting Employees.md at main · Lar...
Contribute to LaravelDaily/Filament-CRM-Course development by creating an account on GitHub.
Want results from more Discord servers?
Add your server