Assigning Team Roles in UserFactory
I'm attempting to replace the built in roles in Jetstream with Spatie laravel-permission team roles.
Their documentation leaves a lot to be desired where it comes to the teams implementation so I feel like I have my work cut out for me. =)
-
So first off, how can I assign roles (which must include a team id) within the UserFactory? I'm initially trying to accomplish this in the
withPersonalTeammethod, but I'm not having any luck so far. I looked into thebootcreation method provided in their docs, and that seem like it would work for logged in users, but obviously we can't access a User in the Team model when no one is logged in. -
When creating new users during normal registration, would I create a new role for their personal team? Or simply assign them to the existing
adminrole with their personal team id?
If anyone has a working implementation to share that would be ideal.
Thanks
Please or to participate in this conversation.