How to manage users in multi tenant app

I need help about having user management on each tenant using users table how to achieve it ?
2 Replies
Ashk
Ashk13mo ago
@Ahloudev what is your db structure ? If you only have one users table, you need to have a relation between your tenants and your users Automatically Filament will filter your resources by the relation between the current resource and the tenant
ahloudev
ahloudevOP13mo ago
i generated UserResource inside my multi tenant app but i got exception that says i should have school_year_id in my users table since SchoolYear is a tenant model in this context
So i added that column to the users table and also added schoolYear(): belongsTo relationship to User model and that fixed the issue but i'm not sure that's the right way to implement user management inside multi tenant application I specify that it is a management application for a educational institution where each school year has its own data (students, teachers, courses, subjects, schedule, etc.).
Want results from more Discord servers?
Add your server