openRoutes as $route) { if ($request->is($route)) { return $next($request); } } if ($request->is('login')) { if (env(API_SECRET) && $request->api_secret === env(API_SECRET)) { return $next($request); } } return parent::handle($request, $next); } }