Laravel facade for verification status of token recieved from Authorization header generated by authmagic authentication core.
$ composer require authmagic/authmagic-timerange-stateless-laravel-middleware
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"
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);
}
authmagic-timerange-stateless-laravel-middleware is MIT licensed.