@citytrader The Sanctum docs has a section on using tokens for authenticating APIs:
https://laravel.com/docs/9.x/sanctum#api-token-authentication
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using Sanctum for my APIs. I wonder whether sending bearer tokens on every authenticated request is good practice. Another option is to use sessions. If I were to use sessions, how would I implement it?
I would also appreciate if you could send me a link of a github repo implementing APIs for authentication PS: Please can anyone recommend the proper way of constructing API for authentication (login, register, logout)
Please or to participate in this conversation.