Skip to content

Laravel Sanctum

Laravel Sanctum is a lightweight authentication system for SPAs and mobile applications, providing token-based API authentication without the complexity of OAuth.

Why It Matters

Sanctum makes it simple to secure APIs while keeping implementation straightforward, ideal for Laravel backends serving Vue.js or mobile apps.

When to Use This

  • Authenticating single-page applications with Laravel backend
  • Securing mobile app API endpoints
  • Managing multiple devices for the same user account
  • API token management for third-party integrations

Examples

  • Mobile app login with token stored securely in keychain
  • SPA authentication with Laravel as API and Vue.js frontend
  • Multiple API tokens per user with selective permissions

Related Terms