PHPackages                             ra-devs/jwt-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ra-devs/jwt-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ra-devs/jwt-auth
================

Universal JWT auth for Laravel (tymon/jwt-auth + ra-devs/api-json-response)

v1.4.4(4mo ago)0346MITPHPPHP &gt;=8.1

Since Sep 10Pushed 4mo agoCompare

[ Source](https://github.com/YasMax91/jwt-auth)[ Packagist](https://packagist.org/packages/ra-devs/jwt-auth)[ RSS](/packages/ra-devs-jwt-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (13)Used By (0)

🔐 ra-devs/jwt-auth
==================

[](#-ra-devsjwt-auth)

**Production-ready JWT authentication package for Laravel**

Built on top of [`tymon/jwt-auth`](https://github.com/tymondesigns/jwt-auth) + [`ra-devs/api-json-response`](https://github.com/YasMax91/api-json-response)

[![Laravel](https://camo.githubusercontent.com/857f6af5e53d03ec19456daf55f588f0684324a59e546887c8bae277c0ee3d64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253242253230253743253230313125324225323025374325323031322532422d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/9847427b3ad37d5f2f3122f63983977e1b0ab038e06a24272d8c4514725c11a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75653f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://php.net)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)

---

✨ Features
----------

[](#-features)

FeatureDescription🔑 **Authentication**Complete auth flow: Login, Register, Logout, Token Refresh🔒 **Password Reset**Secure 8-character alphanumeric codes (A–Z, 2–9) via email🛡️ **Security**Rate limiting, event logging, custom exceptions📊 **Monitoring**Security event logging for audit trails🎯 **Error Handling**Structured error responses with error codes⚡ **Performance**Database indexes, optimized queries🧪 **Testing**Comprehensive test suite with &gt;80% coverage📚 **Documentation**OpenAPI spec, examples, FAQ🔧 **Customizable**User model, Resources, Repositories, Notifications📦 **Publishable**Config, migrations, routes, views---

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Installation](#-installation)
- [Quick Start](#-quick-start)
- [API Endpoints](#-api-endpoints)
- [Configuration](#-configuration)
- [Usage Examples](#-usage-examples)
- [Customization](#-customization)
- [Security Features](#-security-features)
- [Frontend Integration](#-frontend-integration)
- [Testing](#-testing)
- [Documentation](#-documentation)
- [Contributing](#-contributing)

---

🚀 Installation
--------------

[](#-installation)

### Step 1: Install Dependencies

[](#step-1-install-dependencies)

Install the required packages via Composer:

```
composer require tymon/jwt-auth "^2.0"
composer require ra-devs/api-json-response "^1.0"
composer require ra-devs/jwt-auth:dev-main
```

### Step 2: Publish Package Resources

[](#step-2-publish-package-resources)

Publish the configuration, migrations, and views:

```
# Publish configuration
php artisan vendor:publish --provider="RaDevs\JwtAuth\Providers\JwtAuthServiceProvider" --tag=ra-jwt-auth-config

# Publish migrations
php artisan vendor:publish --provider="RaDevs\JwtAuth\Providers\JwtAuthServiceProvider" --tag=ra-jwt-auth-migrations

# Publish views (optional - for email templates)
php artisan vendor:publish --provider="RaDevs\JwtAuth\Providers\JwtAuthServiceProvider" --tag=ra-jwt-auth-views
```

### Step 3: Configure JWT Auth

[](#step-3-configure-jwt-auth)

Publish and configure the base JWT package:

```
# Publish JWT config
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"

# Generate JWT secret key
php artisan jwt:secret
```

### Step 4: Configure Auth Guard

[](#step-4-configure-auth-guard)

Update your `config/auth.php` file:

```
