Download the PHP package vkoori/laravel-stateless-auth without Composer

On this page you can find all versions of the php package vkoori/laravel-stateless-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-stateless-auth

JwtAuth for Laravel

A fully stateless JWT authentication guard and provider for Laravel.
Supports access/refresh tokens, automatic cookie injection, multi-source token parsing (header, query, cookie), and token revocation.


✨ Features


πŸ“¦ Installation

βš™οΈ Configuration

Publish the config file:

This will publish config/jwt-guard.php.

also read optionally

πŸ›‘ Register the Guard & Provider

In your config/auth.php:

πŸ‘€ Token Support on User Model

Your User model must use the provided trait:

🧩 Custom Cache Driver for JWT Token Storage

To prevent JWT tokens from being removed during global cache clears (php artisan cache:clear), you can isolate token storage using a custom cache store.

πŸ”§ Configuration

Use one of the existing cache stores, or define a dedicated store for JWT.

  1. Add a new cache store in config/cache.php:

  2. Define a dedicated Redis connection in config/database.php:

  3. Set the custom driver on your Authenticatable model using the HasApiTokens trait:

πŸ’‘ Why This Matters

By using a dedicated Redis cache store for JWT tokens:

This is especially useful when enable_revoke is set to true in your config, ensuring users are logged out securely while preserving system-wide cache stability.

πŸ” JWT Scope Middleware

This package includes a built-in JwtScopeMiddleware to restrict route access based on scopes defined in the JWT token payload.

πŸ”§ Middleware Registration

βœ… Laravel 12+

In Laravel 12+, middleware is registered using the bootstrap/app.php:

🧱 Laravel 11 and below

If you're using Laravel 11 or older, register the middleware in app/Http/Kernel.php:

βœ… Defining Scopes in Your JWT

Make sure you include the scope claim when generating your access tokens. Example:

πŸ”’ Protect Routes Using Scope Middleware

You can pass multiple allowed scopes or single scope, and access will be granted if at least one matches:

⚠️ Error Handling


All versions of laravel-stateless-auth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
vkoori/laravel-jwt Version ^0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vkoori/laravel-stateless-auth contains the following files

Loading the files please wait ...