isLocal() && !$request->secure()) { // redirect to the mathching secure url // return redirect()->secure($request->path()); } return $next($request); } }