moonshine / jwt
JWT authenticate support for MoonShine
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/moonshine/jwt
Requires
- php: ^8.2|^8.3
- ext-curl: *
- ext-json: *
- lcobucci/jwt: ^5.3
Requires (Dev)
- moonshine/moonshine: ^3
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0
- rector/rector: ^1.0
Conflicts
- laravel/framework: <10.48.0
- moonshine/moonshine: <3.0
This package is auto-updated.
Last update: 2025-09-20 13:22:50 UTC
README
JWT Authentication for MoonShine
A simple way to switch your admin panel to API mode and interact via tokens
Requirements
- MoonShine 3+
- Laravel 10+
- PHP 8.2+
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
moonshine.php
use MoonShine\JWT\JWTAuthPipe; use MoonShine\JWT\Http\Middleware\AuthenticateApi; return [ 'middleware' => [], 'auth' => [ 'middleware' => AuthenticateApi::class, 'pipelines' => [ JWTAuthPipe::class ], ] ];