Multi-tenancy for a filament page
Hi there. I have an app with multi-tenancy and it is working well with all the resources in such panel. For one resource, I had to create a new filament page (not associated with the resource) to do some simple mathematical operations. Sum of total columns and division to calculate percentages. this works great as well. The issue I have is that I cant filter the calculations by tenant. It just add all the values in the table . Can someone provide any advise please?
Solution
Well, if I understood correctly, you needed to do a total calculation somewhere in your app and that is why I suggested the way to complete the total calculations, but yes, for multi tenancy you would need to filter your registered users model with the where condition:
$total_users_count = Users::where('type', 'admin'); (of course you will change it to your own where clause as per the project needs as I am not aware of that so I gave just an example to look for an admin, but can be of course something else
)
$total_users_count = Users::where('type', 'admin'); (of course you will change it to your own where clause as per the project needs as I am not aware of that so I gave just an example to look for an admin, but can be of course something else