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

Conixs's avatar

Check for Permissions in API

Hello, everyone!

I'm building an API, where each role is able to access different end points. I never have done it on an API, in some other systems I already have used spatie/laravel-permission.

Could domeone help me in how to check for permissions on an API? I'm using Passport as auth

0 likes
2 replies
munazzil's avatar

Can you check as like below.

       auth('passport')->user()->permission

Please or to participate in this conversation.