KharNam
1 month ago
255
6
Laravel

Middleware check login not working

Posted 1 month ago by KharNam

HI everyone,I am writing middleware to check login and register in Kernel but get the error below

 public function handle($request, Closure $next)
    {
        if(Auth::check()){
            return $next($request);
        }
        return route('login');
    }

error

Trying to get property 'headers' of non-object

Please sign in or create an account to participate in this conversation.