Skip to content

jwt-auth

JSON Web Token authentication package for Laravel and Lumen PHP apps.

Stars
11.5k
Forks
1.5k
Licence
MIT
Language
PHP
Last update
13 days ago
Type
Library

What it is

jwt-auth is a PHP package that adds JSON Web Token (JWT) login support to Laravel and Lumen applications. A JWT is a signed token a server gives a user after login, which the user sends back with later requests to prove who they are. The package is aimed at developers building APIs or apps that need token-based authentication in these PHP frameworks.

  • Issue a JWT to a user after they log in to a Laravel API
  • Protect API routes so only requests with a valid token are accepted
  • Refresh or invalidate tokens as part of a login flow

Great for

  • Laravel developers building token-based APIs
  • Lumen developers who need JWT authentication
  • Teams that want an MIT-licensed, Packagist-distributed auth package
  • Developers who already know Laravel's authentication concepts

Not ideal for

  • Non-PHP projects, since it only works with Laravel and Lumen
  • Beginners with no Laravel experience, because setup assumes familiarity with the framework
  • Projects needing a hosted login service rather than code in their own app
Step-by-step guide: how to use jwt-authInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: PHP · Composer · Laravel or Lumen project

    Install the package with Composer

    composer require tymon/jwt-auth
  2. 2

    Run it

    • Install the package with Composer in your Laravel or Lumen project
    • Follow the setup guide at jwt-auth.com to configure the package
    • Add the authentication setup to your user model and routes as described in the docs
    • Test a login request and confirm a token is returned
  3. 3

    Get the most out of it

    • Read the full documentation at jwt-auth.com for configuration options
    • Review the package's test suite and badges to understand supported behavior
    • Check the latest release notes for version 2.3.1 before upgrading

Downloads

Strengths

  • Widely starred (11,485 stars) and MIT licensed
  • Installed through Composer from Packagist, a standard PHP workflow
  • Has documentation hosted at jwt-auth.com and automated tests shown in the README badges

Trade-offs

  • The README is short and defers nearly all details to the external documentation site
  • Limited to Laravel and Lumen
  • Security issues must be reported by email rather than the issue tracker

How it compares

ProjectStarsTypeLevelUpdatedBest for
jwt-auth (this)11.5kLibraryintermediate13 days agoLaravel developers building token-based APIs
laravel-permission13kLibraryintermediate15 days agoLaravel developers who need role-based access control in an app
Laravel-Excel12.7kLibraryintermediate14 days agoLaravel developers who need to export database query results to Excel or CSV
framework35kFrameworkintermediate4 days agoPHP developers building web applications or APIs
bagisto28.3kAppintermediate4 days agoDevelopers building a custom online store on Laravel
laravel-crm24.1kAppintermediate4 days agoSmall and mid-sized businesses that want a self-hosted CRM

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.