3

I'm wondering if anyone knows how to link Laravel's Passport tokens to something else then Users. My use-case is a multi-tenant app with Teams and Users. Where a user can belong to multiple teams.

When creating a token it should be linked to a Team instead of a specific user. Same thing goes of course when authenticating through the api, the authentication goes for a Team instead of a specific user.

I'm assuming I need to have the HasApiTokens trait to the Team model and probably a custom provider for the api auth-driver, but i'm not quite sure how to proceed with this.

Thank you in advance for any tips/ideas.

4

0 に答える 0