Looking to hire Laravel developers? Try LaraJobs

authmagic-timerange-stateless-laravel-middleware maintained by authmagic

Description
Authmagic timerange stateless express middleware
Last update
2019/10/29 22:15 (dev-master)
Downloads
36

Comments
comments powered by Disqus

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.