PHPackages                             brenodouglas/laraveljwt - 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. brenodouglas/laraveljwt

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

brenodouglas/laraveljwt
=======================

Package Jwt Laravel

0.2(10y ago)1171MITPHP

Since Mar 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/brenodouglas/laraveljwt)[ Packagist](https://packagist.org/packages/brenodouglas/laraveljwt)[ RSS](/packages/brenodouglas-laraveljwt/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

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

[](#installation)

### 1. Depedency

[](#1-depedency)

Using [composer](https://getcomposer.org/), execute the following command to automatically update your `composer.json`:

```
composer require brenodouglas/laraveljwt
```

or manually update your `composer.json` file

```
{
    "require": {
        "brenodouglas/laraveljwt": "^0.1.0"
    }
}
```

### 2. Provider

[](#2-provider)

You need to update your application configuration in order to register the package, so it can be loaded by Laravel. Just update your `config/app.php` file adding the following code at the end of your `'providers'` section:

```
// file START ommited
    'providers' => [
        // other providers ommited
        \LaravelJwt\JwtProvider::class,
    ],
// file END ommited
```

### 3. Publishing configuration file

[](#3-publishing-configuration-file)

To publish the default configuration file

```
php artisan vendor:publish
```

### 4. Using the middleware

[](#4-using-the-middleware)

To protect your routes, you can use the built-in middlewares.

#### Verify token and regenerate new token in get or header with key 'access-token' : authjwt

[](#verify-token-and-regenerate-new-token-in-get-or-header-with-key-access-token--authjwt)

```
Route::get('foo', ['middleware' => ['authjwt'], function()
{
    return 'Yes I can!';
}]);
```

Or within controllers:

```
$this->middleware('authjwt');
```

### 5. Auth and Facade

[](#5-auth-and-facade)

Register facade and use Jwt authentication. Just update your `config/app.php` file adding the following code at the end of your `'aliases'` section:

```
// file START ommited
    'aliases' => [
        // other aliases ommited
       'JWT' => \LaravelJwt\Facades\JwtAuthFacade::class
    ],
// file END ommited
```

One example route auth and protected route with jwt:

```
Route::post("auth", function(\Illuminate\Http\Request $request) {
    return response()->json(['token'=> \JWT::authenticate($request)]);
});

Route::group(['middleware' => ['authjwt']], function($router) {
    $router->get('users', function() {
        return 'Yes, a can!';
    });
});
```

Send POST for 'auth' route with raw body json:

```
{
    "email": "email@foryouruser.com",
    "password": "password"
}
```

The return is json with a key 'token'.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Total

2

Last Release

3763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ba5e30ffcdf96646ca9ba09525e6d628d604836db2e99e3f2f3b6570b265b5e?d=identicon)[breninho94](/maintainers/breninho94)

---

Top Contributors

[![brenodouglas](https://avatars.githubusercontent.com/u/3895280?v=4)](https://github.com/brenodouglas "brenodouglas (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brenodouglas-laraveljwt/health.svg)

```
[![Health](https://phpackages.com/badges/brenodouglas-laraveljwt/health.svg)](https://phpackages.com/packages/brenodouglas-laraveljwt)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/auth

The Illuminate Auth package.

9327.9M1.2k](/packages/illuminate-auth)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77018.2M124](/packages/laravel-mcp)[illuminate/routing

The Illuminate Routing package.

1239.0M2.9k](/packages/illuminate-routing)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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