Spatie Roles and Permissions package with Multi-Tenancy

Hi, I am building a multi-tenancy app for companies as tenants which has an admin panel separate from tenants panel.

I am using team = true in spatie roles and permissions and I have some set of roles with permissions which I want to assign to each user for different companies.

Like there is a user 1 who is a company admin in company A and moderator in company B, each user can have single role in a company but they can have different roles in different companies.

I am struggling to assign roles to the users as it requires a company_id to assign the role.
My question is how can I assign roles to the user for each company in the form attached as screenshot please?

Thank you so much in advance.
image.png
Was this page helpful?