mark-domkan / env-token-auth
Adds the ability to use environtment token for the auth:api middleware.
1.0.0
2021-03-15 18:17 UTC
Requires
- php: >=7.2.0
This package is auto-updated.
Last update: 2025-04-16 03:03:48 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-token
in the fileconfig/auth.php
:'guards' => [ // ... 'api' => [ 'driver' => 'env-token', // <- Change this FROM token TO env-token // ... ], ],
Usage
-
Add
AUTH_TOKEN
in .env file. -
Make a call with Authorization header with token (without Bearer).
License
The MIT License (MIT). Please see License File for more information.