laravel/airlock
Laravel Sanctum (formerly Airlock) provides a lightweight authentication system for Laravel SPAs and simple APIs, offering first-party SPA cookie auth plus API token issuing and management for users, mobile apps, and third-party clients.
Adopt when:
Look elsewhere when:
For Executives: "Laravel Sanctum lets us ship secure API access for our [SPA/mobile/internal tools] 3–5x faster than building from scratch or using OAuth2. It’s the ‘Swiss Army knife’ for token-based auth: lightweight, battle-tested, and maintained by Laravel’s core team. By adopting Sanctum, we avoid vendor lock-in (MIT license), reduce dev costs, and future-proof our auth layer for [upcoming SaaS/multi-tenant] features. The risk? Minimal—it’s used by thousands of projects, and we can always upgrade to Passport later if needed."
For Engineering: *"Sanctum gives us a drop-in solution for API auth with:
For Developers: *"Sanctum lets you add API auth in minutes:
// Generate a token for a user
$user->createToken('api-token')->plainTextToken;
// Protect a route
Route::middleware('auth:sanctum')->get('/data', ...);
Why not Passport?
oauth_clients, oauth_scopes, etc.; Sanctum only needs personal_access_tokens.
Gotchas:How can I help you explore Laravel packages today?