Spatie roles and permissions team feature

How to fix this issue please, I'm adding new user how can I set a value and use setPermissionsTeamId function
No description
7 Replies
GHOST-117
GHOST-1172y ago
check fillable in ur model
Dennis Koch
Dennis Koch2y ago
Please share some code.
AngryTestie
AngryTestieOP2y ago
@Dennis Koch I need to set the company id using setPermissionsTeamId, I'm getting this error when I'm creating new user and setting the role.
No description
Dennis Koch
Dennis Koch2y ago
The name should give you a hint. afterCreate() runs after creation. Therefore it is too late to add non-nullable values. Use a render hook that runs before saving.
AngryTestie
AngryTestieOP2y ago
@Dennis Koch What should I use?sorry I'm new I also tried the beforeCreate
Dennis Koch
Dennis Koch2y ago
I don't even know where you are using this/in which context because you never explained

Did you find this page helpful?