diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index 74074f09105f..68ca758e153f 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -200,6 +200,21 @@ public function attach($name, $contents, $filename = null, array $headers = []) return $this; } + + /** + * Attach multiple files to the request. Accepts an array containing arrays of files + * + * @param array $files + * @return $this + */ + public function attachMany(array $files) + { + foreach ($files as $file) { + $this->attach(...$file); + } + + return $this; + } /** * Indicate the request is a multi-part form request.