PHPackages                             think.studio/laravel-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. think.studio/laravel-jwt-auth

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

think.studio/laravel-jwt-auth
=============================

Another laravel jwt auth package.

3.3.0(2y ago)017MITPHPPHP ^8.1

Since Jun 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dev-think-one/laravel-jwt-auth)[ Packagist](https://packagist.org/packages/think.studio/laravel-jwt-auth)[ Docs](https://github.com/dev-think-one/laravel-jwt-auth)[ RSS](/packages/thinkstudio-laravel-jwt-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (14)Used By (0)

Another laravel jwt auth
========================

[](#another-laravel-jwt-auth)

[![Packagist License](https://camo.githubusercontent.com/c4c63f14640c8716131ffe5bdb7cfdcadf9add6f791fbe9f4a92ad0a321042b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7468696e6b2e73747564696f2f6c61726176656c2d6a77742d617574683f636f6c6f723d253233346463373166)](https://camo.githubusercontent.com/c4c63f14640c8716131ffe5bdb7cfdcadf9add6f791fbe9f4a92ad0a321042b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7468696e6b2e73747564696f2f6c61726176656c2d6a77742d617574683f636f6c6f723d253233346463373166)[![Packagist Version](https://camo.githubusercontent.com/5084121d1c8288904ef77778252ff38781c28cfa3066985f2fad0edb8c92e814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468696e6b2e73747564696f2f6c61726176656c2d6a77742d61757468)](https://packagist.org/packages/think.studio/laravel-jwt-auth)[![Total Downloads](https://camo.githubusercontent.com/e2cb772387afa8572c21de6c179030367c6d7fe1df2d3c98ac11c358d7f639c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468696e6b2e73747564696f2f6c61726176656c2d6a77742d61757468)](https://packagist.org/packages/think.studio/laravel-jwt-auth)[![Build Status](https://camo.githubusercontent.com/fa476180565edde6023bf328a612682eecff93cc9dd7d13ea4efba6832d9652f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6c61726176656c2d6a77742d617574682f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/laravel-jwt-auth/build-status/main)[![Code Coverage](https://camo.githubusercontent.com/e958994c8c5b7b1a69c542aa660e43fdfeb5ea612b47f25aee56156d7beb1602/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6c61726176656c2d6a77742d617574682f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/laravel-jwt-auth/?branch=main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a237663a49d84095786cbb5fa94459097e0775af05251ef5df35f9ac903d7c92/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6c61726176656c2d6a77742d617574682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/laravel-jwt-auth/?branch=main)

Another laravel jwt auth package.
This package has very slow support, you might be better off switching to an older and more used package: [tymon/jwt-auth](https://github.com/tymondesigns/jwt-auth)

Installation
------------

[](#installation)

Install the package via composer:

```
composer require think.studio/laravel-jwt-auth
```

You can publish the config file with:

```
php artisan vendor:publish --provider="JWTAuth\ServiceProvider" --tag="config"
```

You can publish migrations:

```
php artisan vendor:publish --provider="JWTAuth\ServiceProvider" --tag="migrations"
```

If you don't have encryption / decryption keys, generate them using the command

```
php artisan jwt:keys:generate
```

Configuration
-------------

[](#configuration)

Update auth configuration

```
// config/auth.php
  'guards' => [
        // ...
        'my_api_guard_name' => [
            'driver'      => 'jwt',
            'provider'    => 'users',
            'public_key'  => env('JWT_PUBLIC_KEY', 'jwt-keys/jwtRS256.key.pub'),
            'private_key' => env('JWT_PUBLIC_KEY', 'jwt-keys/jwtRS256.key'),
            'blocklist'   => 'filesystem',
            'options'     => [],
        ],
    ],
```

Update User model

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use JWTAuth\Contracts\WithJwtToken;

class User extends Authenticatable implements WithJwtToken
{
    use \JWTAuth\Eloquent\HasJwtToken;
    //...
}
```

Usage
-----

[](#usage)

Login

```
/** @var \JWTAuth\JWTGuard $auth */
$auth = Auth::guard('my_api_guard_name');
$token = $auth->attempt($request->only( 'email', 'password'));
if ($token) {
    $user = $auth->user();
    echo "Access token: {$token}";
    echo "User id: {$user->id}";
}
```

Logout

```
if(Auth::guard('my_api_guard_name')->check()) {
    Auth::guard('my_api_guard_name')->logout();
}
```

Credits
-------

[](#credits)

- [![Think Studio](https://camo.githubusercontent.com/8e541bece07d503c85a126b5294865faa00e27371048772f566a0cce8c01fd3a/68747470733a2f2f7961726f736c617777772e6769746875622e696f2f696d616765732f73706f6e736f72732f7061636b616765732f6c6f676f2d7468696e6b2d73747564696f2e706e67)](https://think.studio/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Recently: every ~109 days

Total

13

Last Release

975d ago

Major Versions

1.1.1 → 2.0.02021-08-11

2.1.2 → 3.0.02022-06-30

PHP version history (3 changes)1.0.0PHP &gt;=7.4

2.0.0PHP ^8.0

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/53f93fa87d58f33d106de6bd5e2946f8a345ebfaee146360746056cb134a15a0?d=identicon)[think.studio](/maintainers/think.studio)

---

Top Contributors

[![yaroslawww](https://avatars.githubusercontent.com/u/23663794?v=4)](https://github.com/yaroslawww "yaroslawww (23 commits)")

---

Tags

jwtlaravelauth

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thinkstudio-laravel-jwt-auth/health.svg)

```
[![Health](https://phpackages.com/badges/thinkstudio-laravel-jwt-auth/health.svg)](https://phpackages.com/packages/thinkstudio-laravel-jwt-auth)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[generationtux/jwt-artisan

JWT auth package for Laravel and Lumen

13953.1k](/packages/generationtux-jwt-artisan)[benbjurstrom/cognito-jwt-guard

A laravel auth guard for JSON Web Tokens issued by Amazon AWS Cognito

1113.1k](/packages/benbjurstrom-cognito-jwt-guard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
