diff --git a/src/Illuminate/Support/Facades/Http.php b/src/Illuminate/Support/Facades/Http.php index 83217a04b22..60489694d3c 100644 --- a/src/Illuminate/Support/Facades/Http.php +++ b/src/Illuminate/Support/Facades/Http.php @@ -138,12 +138,13 @@ public static function fakeSequence(string $urlPattern = '*') /** * Indicate that an exception should be thrown if any request is not faked. * + * @param bool $prevent * @return \Illuminate\Http\Client\Factory */ - public static function preventStrayRequests() + public static function preventStrayRequests($prevent = true) { - return tap(static::getFacadeRoot(), function ($fake) { - static::swap($fake->preventStrayRequests()); + return tap(static::getFacadeRoot(), function ($fake) use ($prevent) { + static::swap($fake->preventStrayRequests($prevent)); }); }