DEV Community

Discussion on: Laravel Jetstream vs Breeze vs Laravel/ui

Collapse
 
nathanheffley profile image
Nathan Heffley

Sanctum is a package to make it easy to authenticate stateless requests, specifically for API's using tokens, and/or for SPA authentication without mucking around with JWT tokens.

It is something you could install alongside Breeze (especially if you are only using it for API tokens most likely) or if you are using it for SPA authentication it could be installed on its own. The docs are really good and we're just revamped for devs new to Laravel: laravel.com/docs/8.x/sanctum

Passport is a totally different beast. It provides your users a way to connect to it app using OAuth, which is almost certainly not how you want your users to connect to your API when using a first-party SPA (although there's nothing wrong with that if you really want to go that way). The Passport docs even have a section discussing Passport vs Sanctum: laravel.com/docs/8.x/passport#pass...