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

anburocky3's avatar

Building Laravel API's best practices?

Any people who have built laravel API's for enterprise-level applications?

Which one to use, Sanctum or Passport for authentication?

My primary usage is to link the backend(laravel api) with the vue frontend. Which authentication is okay for this?

0 likes
1 reply
davorminchorov's avatar
  • If you plan to use oAuth 2 for authentication, use Passport.
  • If you plan to put the frontend and the backend on the same domain, use Sanctum
  • If you plan to put the frontend and the backend on different domains, use JWT / Passport
2 likes

Please or to participate in this conversation.