expectsJson()) { return route('login'); } } public function handle($request, Closure $next, ...$guards) { $jwt = $request->cookie('jwt'); if ($jwt) { # code... $request->headers->set('Authorization', 'Bearer ' . $jwt); } // $output = new \Symfony\Component\Console\Output\ConsoleOutput(); // $output->writeln($request->cookie('jwt')); // $output->writeln('author : ' . $request->header('Authorization')); // $output->writeln('cookie : ' . $request->header('cookie')); $this->authenticate($request, $guards); return $next($request); } }