F
Filament4mo ago
Kleis

User administration for tenants

I would like to have a page where the tenants can manage their members, ie. change role/profile information and invite new members. If I simply make a resource for the Organization model (which is my tenant model) and make a relationshipManager on that, then I can access the organization and modify the user and pivot attribute. But I want the tenants to be able to do that also, but obviously only for their current tenant... Any ideas how to do this the best way?
Solution:
Overwrite the getEloquentQuery() method on the Resource and add a ->where() clause when the user is a tenant
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch4mo ago
Overwrite the getEloquentQuery() method on the Resource and add a ->where() clause when the user is a tenant
Kleis
KleisOP4mo ago
Thanks, that actually works wonders, although the url becomes a bit redundant, by having the ID 2 times "/admin/3/organizations/3/edit" Ideally it should just be /admin/3/organization or something like that
Want results from more Discord servers?
Add your server