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

harishdurga's avatar

Laravel Sanctum - Issuing tokens for different types users

I have 3 different types of users in separate tables. I am using Sanctum to issues tokens. Each type of user will be using different application connected to same database. Ex: admin.mysite.com, customer.mysite.com and merchant.mysite.com. I am using the auth:sanctum middleware. The token i have issued for Consumer is passing the sanctum guard in the merchant. And vice versa. How to prevent this? Should i need to implement my own middleware to check the tokenable_type of the token or is there any config in sanctum to do this?

0 likes
1 reply

Please or to participate in this conversation.