authmagic / authmagic-timerange-stateless-laravel-middleware
There is no license information available for the latest version (v0.0.3) of this package.
Authmagic timerange stateless express middleware
v0.0.3
2019-10-29 21:15 UTC
Requires
- guzzlehttp/guzzle: ^6.3
This package is not auto-updated.
Last update: 2025-05-07 23:37:30 UTC
README
authmagic-timerange-stateless-laravel-middleware
Laravel facade for verification status of token recieved from Authorization header generated by authmagic authentication core.
How to install
$ composer require authmagic/authmagic-timerange-stateless-laravel-middleware
Publish the configurations
Run this on the command line from the root of your project for copy authmagic.php config to laravel config folder:
$ php artisan vendor:publish --provider="Authmagic\AuthmagicLaravel\AuthmagicServiceProvider"
Usage
Create middleware with handle method.
public function handle($request, Closure $next) { $token = Authmagic::auth($request); if ($token) { // ... return $next($request); } return response('Unauthorized action', Response::HTTP_FORBIDDEN); }
Licence
authmagic-timerange-stateless-laravel-middleware is MIT licensed.