PHPackages                             bayareawebpro/laravel-simple-jwt - 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. bayareawebpro/laravel-simple-jwt

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

bayareawebpro/laravel-simple-jwt
================================

Simple JsonWebToken for Laravel

v1.0.6(5y ago)19421MITPHPPHP ^7.4|^8.0

Since Jul 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bayareawebpro/laravel-simple-jwt)[ Packagist](https://packagist.org/packages/bayareawebpro/laravel-simple-jwt)[ Docs](https://github.com/bayareawebpro/laravel-simple-jwt)[ RSS](/packages/bayareawebpro-laravel-simple-jwt/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

Laravel Simple JWT Authentication
=================================

[](#laravel-simple-jwt-authentication)

[![CI](https://github.com/bayareawebpro/laravel-simple-jwt/workflows/ci/badge.svg)](https://github.com/bayareawebpro/laravel-simple-jwt/workflows/ci/badge.svg)[![Coverage](https://camo.githubusercontent.com/2874818ee69478ff4053d2ff3e5ef6c38e7911d6630ee5c7d0eae7c29addf081/68747470733a2f2f636f6465636f762e696f2f67682f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://camo.githubusercontent.com/2874818ee69478ff4053d2ff3e5ef6c38e7911d6630ee5c7d0eae7c29addf081/68747470733a2f2f636f6465636f762e696f2f67682f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742f6272616e63682f6d61737465722f67726170682f62616467652e737667)[![Downloads](https://camo.githubusercontent.com/fba23d3d1aa413fb05cb92bc1a2f9fcaea47ac296abb0dfa2ef848ed540c10ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742e737667)](https://camo.githubusercontent.com/fba23d3d1aa413fb05cb92bc1a2f9fcaea47ac296abb0dfa2ef848ed540c10ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742e737667)[![Version](https://camo.githubusercontent.com/90dceee1179418cab8d634a709901114d4ff9a96ea91ba400aa5a55e5a6c6db8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742e737667)](https://camo.githubusercontent.com/90dceee1179418cab8d634a709901114d4ff9a96ea91ba400aa5a55e5a6c6db8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6261796172656177656270726f2f6c61726176656c2d73696d706c652d6a77742e737667)[![License](https://camo.githubusercontent.com/b60ae987297da06088ea8e815265e37e4627c6f6485d19a3dcb963b576141b28/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d737563636573732e737667)](https://camo.githubusercontent.com/b60ae987297da06088ea8e815265e37e4627c6f6485d19a3dcb963b576141b28/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d737563636573732e737667)

```
composer require bayareawebpro/laravel-simple-jwt
```

### Create Encryption Secret

[](#create-encryption-secret)

```
artisan jwt:secret
```

### Add Secret to Environment File

[](#add-secret-to-environment-file)

```
JWT_SECRET=XXX
```

### Configure Auth.php

[](#configure-authphp)

```
'guards' => [
    ...
    'api' => [
        'driver' => 'simple-jwt',
        'provider' => 'users',
        'hash' => false,
    ],
],

```

### Register in Auth Service Provider.

[](#register-in-auth-service-provider)

```
JsonWebToken::register(User::class, 'token');
```

### Create New Token, Expiration, and Claims

[](#create-new-token-expiration-and-claims)

```
$token = JsonWebToken::createForUser(User::first(), now()->addHours(3), [
  'my_key' => true
]);
```

### Authenticate

[](#authenticate)

Query String

```
http://laravel.test/api/user?token=xxx

```

Or Header

```
Authorization: Bearer XXX

```

### Get Claims From Token

[](#get-claims-from-token)

```
$request->jwt()->get('my_key');
$request->jwt('my_key');
```

### Extend Token Lifetime &amp; Claims

[](#extend-token-lifetime--claims)

```
$newToken = JsonWebToken::extendToken(request()->jwt(), now()->addHours(3), ['key' => true]);
```

### Blacklist Handler

[](#blacklist-handler)

```
$bannedUUID = request()->jwt('jti');
```

```
JsonWebToken::rejectionHandler(fn($parsed)=>in_array($parsed->get('jti'),[
    $bannedUUID
]));
```

### Testing

[](#testing)

```
composer test
composer lint
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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 ~33 days

Recently: every ~49 days

Total

7

Last Release

1936d ago

PHP version history (2 changes)v1.0PHP ^7.4

v1.0.4PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/93d3895de269a38f94d24217615daba9bd5a47439d1813203775961d47be269e?d=identicon)[bayareawebpro](/maintainers/bayareawebpro)

---

Top Contributors

[![bayareawebpro](https://avatars.githubusercontent.com/u/2476179?v=4)](https://github.com/bayareawebpro "bayareawebpro (19 commits)")

---

Tags

authjwtlaravelsimplejwtlaravelauthtokenbayareawebpro

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bayareawebpro-laravel-simple-jwt/health.svg)

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

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)

PHPackages © 2026

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