Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Jwt Laravel Package

codecasts/laravel-jwt

JWT authentication for Laravel: generate and validate JSON Web Tokens, protect routes with auth middleware, and add stateless token-based authentication to APIs and apps. A lightweight integration for securing Laravel endpoints with configurable JWT guards.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API authentication feature (build vs. buy): This package is a "buy" shortcut for adding stateless, token-based authentication to a Laravel API. It covers the common 80% — issue a signed token, validate it, refresh it, invalidate it, resolve the authenticated user — so the team isn't writing JWT encoding/claim handling from scratch. MIT license, no vendor cost.
  • Roadmap: decoupling auth from sessions. Supports moving a product from cookie/session auth toward token auth so the same backend can serve a web SPA, a mobile client, and third-party/partner API consumers without per-client session infrastructure.
  • Multi-client enablement. Useful when roadmap items (mobile app, public API, embedded integrations) require clients that can't hold server sessions — a shared decision that touches API design, rate limiting, and client SDK work.
  • Time-to-market for non-differentiating work. Auth is rarely the product's differentiator. For an MVP, internal tool, or a time-boxed pilot, this is a legitimate way to buy back days of engineering.
  • Scope boundaries it does not settle: it is not an OAuth2 authorization server, and the description shows no scopes/abilities, authorization-code or client-credentials grants, key rotation/JWKS, denylists, or MFA. If the roadmap includes delegated third-party authorization ("Sign in with our product," partner apps acting on behalf of users), this package does not answer that question — that's Passport or a dedicated IdP.
  • Technical-debt ledger. Adopting it creates a named liability: the package's last release is 2017-06-29, roughly eight years without upstream maintenance. This should be recorded as an explicit, owned risk item with a migration owner and a target quarter, not adopted silently.

When to Consider This Package

Consider it when:

  • You are maintaining a legacy Laravel (5.x-era) application that already depends on it. The pragmatic call is to keep it running until a scheduled auth migration, rather than doing an unplanned mid-quarter rewrite.
  • You need a prototype or internal tool with a hard time box, non-public users, and low blast radius if auth breaks.
  • Your framework version is old enough that first-party options (Sanctum) aren't available, and Passport's full OAuth2 surface is overkill for a simple "token in, user out" flow.
  • Your requirements are genuinely limited to: issue, validate, refresh, invalidate, retrieve user, and a configurable secret and TTL.

Look elsewhere when:

  • Any new build. On Laravel 8/9/10/11/12, use Laravel Sanctum for SPA/API-token auth or Passport for real OAuth2. First-party, maintained, documented, and covered by framework security releases. This is the default recommendation.
  • You want a maintained third-party JWT library. tymon/jwt-auth (actively maintained) or firebase/php-jwt plus a thin in-house guard (~150–250 lines) gives you control over claims, signing algorithms, and revocation without inheriting an abandoned dependency.
  • Package-health thresholds apply. 229 stars on a security-critical surface is a thin community; a 2017 last release means no patches for CVEs, no compatibility fixes, and effectively a bus factor of zero. The low opportunity score (3.03) against a moderate overall score (4.15) reads the same way: usable, not strategically valuable.
  • You face dependency scrutiny. SOC 2, pen tests, or SCA tooling will flag an unmaintained auth library. Cost of an exception approval likely exceeds the integration savings.
  • You need anything beyond basic stateless auth: refresh-token revocation lists, asymmetric signing (RS256) with key rotation, token denylists for logout-everywhere, scoped permissions, or multi-tenant token claims. Verify explicitly; assume out of scope.

How to Pitch It (Stakeholders)

To executives (one paragraph): This is a free, MIT-licensed shortcut for adding token-based API login to older Laravel applications. It removes a few days of engineering on commodity functionality, so it's a delivery accelerator — not a strategic investment. Its last release was in 2017 and it has a small community, so we should treat it as temporary technical debt rather than a platform standard. Recommendation: do not standardize on it; use it only for time-boxed work or where we're already committed, and budget a migration to Laravel's first-party auth as a planned roadmap item.

To engineering (summary): Narrow, easy-to-integrate surface — auth guard, middleware, issue/validate/refresh/invalidate helpers, configurable secret and TTL, and user resolution from a token. That's the appeal. The costs are concrete: it targets legacy Laravel auth contracts (confirm Composer constraints before committing), no upstream fixes for framework or security issues, and we own the security review. Two things to verify in a one-day spike: (1) does "invalidate" mean true revocation or just client-side expiry, and (2) does refresh rotate the token with reuse protection? Exit path: Sanctum (preferred) or Passport; alternatively a thin in-house guard over firebase/php-jwt gives us equivalent behavior with full control and no unmaintained dependency. Sizing the migration now costs little and makes the debt a decision rather than an accident.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource