Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Haskell's avatar

Api Token for not user model

Hi,

I use Passport to create API authentication, it works perfectly for my User authentication! But.. I have Group model and I want to create api token(personal access token i guess) and let this Group manage its resources at its own. I added use HasApiTokens to my Group model and created token by $group->createToken("token")->accessToken but i cant authenticate 'group' in my route - i get response { "message": "Unauthenticated." }.

Am i doing it in good way? How should i achieve it?

0 likes
1 reply

Please or to participate in this conversation.