public function create(string $title, array $optional = []): Response
    {
        $files = [];
        $body = \array_merge(\compact('title'), $optional);

        if (isset($body['logo'])) {
            $files['logo'] = \ltrim($body['logo'], '@');
            unset($body['logo']);
        }

        list($headers, $stream) = $this->prepareMultipartRequestPayloads([], $body, $files);

        return $this->stream('POST', 'collections', $headers, $stream);
    }
public function create(string $title, array $optional = []): Response
    {
        $files = [];
        $body = \array_merge(\compact('title'), $optional);

        if (isset($body['logo'])) {
            $files['logo'] = \ltrim($body['logo'], '@');
            unset($body['logo']);
        }

        list($headers, $stream) = $this->prepareMultipartRequestPayloads([], $body, $files);

        return $this->stream('POST', 'collections', $headers, $stream);
    }
public function create ( string $ title , array $ optional = [ ] ) : Response { $ files = [ ] ; $ body = \ array_merge ( \ compact ( 'title' ) , $ optional ) ; if ( isset ( $ body [ 'logo' ] ) ) { $ files [ 'logo' ] = \ ltrim ( $ body [ 'logo' ] , '@' ) ; unset ( $ body [ 'logo' ] ) ; } list ( $ headers , $ stream ) = $ this -> prepareMultipartRequestPayloads ( [ ] , $ body , $ files ) ; return $ this -> stream ( 'POST' , 'collections' , $ headers , $ stream ) ; }
Create a new collection.

@param  string  $title
@param  array  $optional

@return \Laravie\Codex\Contracts\Response
Create a new collection .