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

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

magico/jwt-auth
===============

A JWT authentication package for Laravel.

v1.0.5(9mo ago)09PHPPHP ^8.1

Since Aug 27Pushed 9mo agoCompare

[ Source](https://github.com/abbashashem283/jwt-auth)[ Packagist](https://packagist.org/packages/magico/jwt-auth)[ RSS](/packages/magico-jwt-auth/feed)WikiDiscussions main Synced today

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

1- install the package

2-export jwt-auth package config, also generate token secrets using this command php artisan jwt-generate --key=JWT\_SECRET php artisan jwt-generate --key=REFRESH\_SECRET php artisan jwt-generate --key=CSRF\_SECRET

set the token configurations in config/jwt-auth.php as "access" =&gt; \[ "secret" =&gt; env("JWT\_SECRET"), "algorithm" =&gt; "HS256", "ttl" =&gt; 60 \], "refresh" =&gt; \[ "secret" =&gt; env("REFRESH\_SECRET"), "algorithm" =&gt; "HS256", "ttl" =&gt; 10080 \], "csrf" =&gt; \[ "secret" =&gt; env("CSRF\_SECRET"), "algorithm" =&gt; "HS256", "ttl" =&gt; 1440 \],

3- create password reset and email verification views (email verification has a property $link and password verification has a property $code) for example I created auth.email\_verification &amp; auth.password\_reset and link them to your config/jwt-auth.php as "mail\_service\_views" =&gt; \[ "emailVerification"=&gt;"auth.email\_verification", "passwordReset"=&gt;"auth.password\_reset" \]

4- run the migrations of the package php artisan migrate

5- install laravel sanctum php artisan install:api

6- modify config/auth.php

'defaults' =&gt; \[ 'guard' =&gt; env('AUTH\_GUARD', 'api'), 'passwords' =&gt; env('AUTH\_PASSWORD\_BROKER', 'users'), \],

and

'guards' =&gt; \[ 'web' =&gt; \[ 'driver' =&gt; 'session', 'provider' =&gt; 'users', \], 'api' =&gt; \[ 'driver' =&gt; 'jwt', 'provider' =&gt; 'users' \] \],

7- set email mail server settings in .env file as in MAIL\_MAILER=smtp MAIL\_HOST=smtp.gmail.com MAIL\_PORT=587 MAIL\_USERNAME= "put your email here" MAIL\_PASSWORD="password you got from google" MAIL\_ENCRYPTION=tls MAIL\_FROM\_ADDRESS="put your email here" MAIL\_FROM\_NAME="Jwt Auth"

8-Make sure user model has the following fields (email verified at, email, password) and it must extend Authenticatable and use the HasJwtAuthTokens trait

9- in routes/api.php add sample routes like Route::prefix("auth")-&gt;controller(AuthController::class)-&gt;group( function () { Route::post("/login","login")-&gt;name("auth.login"); Route::post("/logout","logout")-&gt;name("auth.logout"); Route::post("/refresh","refresh")-&gt;name("auth.refresh"); Route::post("/register","register")-&gt;name("auth.register"); Route::post("/password/forgot-password", "forgotPassword")-&gt;name("auth.password.forgot"); Route::post("/password/check-code", "checkPasswordCode")-&gt;name("auth.password.code"); Route::post("/password/reset", "resetPassword")-&gt;name("auth.password.reset"); Route::get("/verify","verify")-&gt;name("auth.verify"); Route::get("/hi", "greet"); Route::get("/user", "user")-&gt;name("auth.user"); }

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Total

6

Last Release

297d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/125282275?v=4)[Abbas Hashem](/maintainers/abbashashem283)[@abbashashem283](https://github.com/abbashashem283)

---

Top Contributors

[![abbashashem283](https://avatars.githubusercontent.com/u/125282275?v=4)](https://github.com/abbashashem283 "abbashashem283 (10 commits)")

### Embed Badge

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

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

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k294.2M219](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

25310.7M83](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5181.2M3](/packages/robsontenorio-laravel-keycloak-guard)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[rainlab/user-plugin

User plugin for October CMS

11955.0k15](/packages/rainlab-user-plugin)

PHPackages © 2026

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