Basic JWT auth middleware
Sep 5, 2018 · 1 min read
Sometime we don’t want to use built in middleware for authenticate our route and validate if it is having valid authorization bearer or not.To solve this problem i have created a very basic middleware to serve my purpose of not depending on the default one rather use my own customized one.
We can add middleware class in our controller like this way or we can add in the route also:
public function __construct()
{
$this->middleware(JWTauth::class);
}