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

BernardoBF4's avatar

Auth and session

I am implementing a ticket selling website. This website is going to use an authentication system made by myself. I want to make it because I believe that it's good to have done to it once at least, and I also want to understant how to use sessions, TDD and the auth()/Auth helper/class. I am probably having an Auth controller for the CMS and another for the users of the site. I don't know properly how implement those yet and that's why I'd like to know if anyones has references of where to learn about sessions and auth.

I am after a manner to to authenticate a user and store it in a session and also to pass a user token to the fronend so that axios requests can use the token on the header for routes that require authentication. I don't how to do it, that's why I am coming to you.

0 likes
1 reply
Snapey's avatar

with respect, learn on something that is not so critical to the success of your site

Laravel has perfectly good and thoroughly tested by tens of thousands of developers

Also, avoid creating multiple authentication guards. A user is a user. Its authorization that determines what they are allowed to do.

Please or to participate in this conversation.