A new payload() method has been added to the PasetoGuard for easier and more fluent access to token claims. This method returns the token's payload as an Illuminate\Support\Collection, allowing for convenient method chaining.
use Illuminate\Support\Facades\Auth;
// Get the full payload as a collection
$payload = Auth::guard('api')->payload();
// Retrieve a specific claim, e.g., the JWT ID (jti)
$jti = Auth::guard('api')->payload()->get('jti');
We are excited to announce the first stable release of laravel-paseto!
This package provides a complete, secure, and easy-to-integrate PASETO (Platform-Agnostic Security Tokens) authentication guard for modern Laravel applications. It is designed to be a safer, more robust alternative to JWT, with a focus on simplicity and security by default.
paseto authentication driver for Laravel's auth system.paseto.php) allows you to customize the token's lifetime, issuer, audience, and default claims.php artisan paseto:generate-key to generate a secure secret key and add it to your .env file automatically.HasPaseto Trait: Easily add token generation capabilities to your User model.How can I help you explore Laravel packages today?