mark-domkan / env-token-auth
Adds the ability to use environtment token for the auth:api middleware.
Installs: 78
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mark-domkan/env-token-auth
Requires
- php: >=7.2.0
This package is auto-updated.
Last update: 2025-10-16 04:14:25 UTC
README
Adds the ability to use token saved in env for the auth:api middleware.
Install
-
Install the package with composer:
composer require markdomkan/env-token-auth
-
Set the api guard driver to
env-tokenin the fileconfig/auth.php:'guards' => [ // ... 'api' => [ 'driver' => 'env-token', // <- Change this FROM token TO env-token // ... ], ],
Usage
-
Add
AUTH_TOKENin .env file. -
Make a call with Authorization header with token (without Bearer).
License
The MIT License (MIT). Please see License File for more information.