PHPackages                             moonshine/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. moonshine/jwt

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

moonshine/jwt
=============

JWT authenticate support for MoonShine

2.0.0(6mo ago)32662MITPHPPHP ^8.2|^8.3CI passing

Since Oct 13Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/moonshine-software/jwt)[ Packagist](https://packagist.org/packages/moonshine/jwt)[ Docs](https://moonshine-laravel.com)[ RSS](/packages/moonshine-jwt/feed)WikiDiscussions 2.x Synced 1mo ago

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

### JWT Authentication for MoonShine

[](#jwt-authentication-for-moonshine)

A simple way to switch your admin panel to API mode and interact via tokens

[Documentation](https://moonshine-laravel.com/docs/3.x/frontend/api#jwt)

Requirements
------------

[](#requirements)

- MoonShine 3+
- Laravel 10+
- PHP 8.2+

#### Installation

[](#installation)

```
composer require moonshine/jwt
```

```
php artisan vendor:publish --provider="MoonShine\JWT\Providers\JWTServiceProvider"
```

Add the base64 encoded secret key to the JWT\_SECRET variable in the .env file

```
JWT_SECRET=YOUR_BASE64_SECRET_HERE
```

#### Usage

[](#usage)

#### config/moonshine.php in v3.\*

[](#configmoonshinephp-in-v3)

```
use MoonShine\JWT\JWTAuthPipe;
use MoonShine\JWT\Http\Middleware\AuthenticateApi;
return [
    'middleware' => [],
    'auth' => [
        'middleware' => AuthenticateApi::class,
        'pipelines' => [
            JWTAuthPipe::class
        ],
    ]
];
```

#### config/moonshine.php in v4.\*

[](#configmoonshinephp-in-v4)

```
use MoonShine\JWT\JWTAuthPipe;
use MoonShine\JWT\Http\Middleware\AuthenticateApi;
return [
    'middleware' => [],
    'auth' => [
        'middleware' => [
            AuthenticateApi::class,
        ],
        'pipelines' => [
            JWTAuthPipe::class
        ],
    ]
];
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance68

Regular maintenance activity

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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 ~98 days

Total

5

Last Release

188d ago

Major Versions

1.x-dev → 2.0.02025-11-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1861327?v=4)[Danil Shutsky](/maintainers/lee-to)[@lee-to](https://github.com/lee-to)

---

Top Contributors

[![lee-to](https://avatars.githubusercontent.com/u/1861327?v=4)](https://github.com/lee-to "lee-to (18 commits)")[![warete](https://avatars.githubusercontent.com/u/12802923?v=4)](https://github.com/warete "warete (2 commits)")

---

Tags

jwtapilaraveldashboardadminmoonshine

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/moonshine-jwt/health.svg)

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

###  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)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[tuandm/laravue

A beautiful dashboard for Laravel built by VueJS

2.2k16.6k](/packages/tuandm-laravue)

PHPackages © 2026

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