src/Concerns/Request/Multipart.php
final protected function addBodyToMultipartBuilder(Builder $builder, array $body, ?string $prefix = null): void
    {
        foreach ($body as $key => $value) {
            $name = $key;

            if (! \is_null($prefix)) {
                $name = "{$prefix}[{$key}]";
            }

            if (\is_array($value)) {
                $this->addBodyToMultipartBuilder($builder, $value, $name);
                continue;
            }

            $builder->addResource($name, $value, ['Content-Type' => 'text/plain']);
        }
    }
final protected function addBodyToMultipartBuilder(Builder $builder, array $body, ?string $prefix = null): void
    {
        foreach ($body as $key => $value) {
            $name = $key;

            if (! \is_null($prefix)) {
                $name = "{$prefix}[{$key}]";
            }

            if (\is_array($value)) {
                $this->addBodyToMultipartBuilder($builder, $value, $name);
                continue;
            }

            $builder->addResource($name, $value, ['Content-Type' => 'text/plain']);
        }
    }
final protected function addBodyToMultipartBuilder ( Builder $ builder , array $ body , ? string $ prefix = null ) : void { foreach ( $ body as $ key => $ value ) { $ name = $ key ; if ( ! \ is_null ( $ prefix ) ) { $ name = "{$prefix}[{$key}]" ; } if ( \ is_array ( $ value ) ) { $ this -> addBodyToMultipartBuilder ( $ builder , $ value , $ name ) ; continue ; } $ builder -> addResource ( $ name , $ value , [ 'Content-Type' => 'text/plain' ] ) ; } }
Add body to multipart stream builder.

@param  \Http\Message\MultipartStream\MultipartStreamBuilder  $builder
@param  array  $body
@param  string|null  $prefix

@return void
Add body to multipart stream builder .