Asigning role to existant user on Team

New battle against Roles. Using this plugin to create roles + permissions and associate role to user. (https://filamentphp.com/plugins/tharinda-rodrigo-spatie-roles-permissions) When associating role to User I've got this message. Note that I've add team_id foreign on role, permission and model_has_roles + model_has_permissions table to make all Tenant + Roles + Permissions working with users
Filament
Spatie Roles Permissions by Tharinda Rodrigo - Filament
Filament support for spatie/laravel-permission.
No description
4 Replies
Kerchack
Kerchack11mo ago
Is there a way to associate manually current team_id for this insert?
tharindarodrigo
tharindarodrigo11mo ago
I will look into this matter over the weekend.
Kerchack
Kerchack11mo ago
Thank you so much @tharindarodrigo
tharindarodrigo
tharindarodrigo11mo ago
@kerchack_ast Does this happen within your UserResource when you try to attach Role to the user? Probably using the following?
Select::make('roles')
->multiple()
->preload()
Select::make('roles')
->multiple()
->preload()