src/Primitive/Container/Container.php
public function combine($array, $what = 'keys')
    {
        $array = $this->retrieveValue($array);

        if (count($array) !== $this->length())
        {
            throw new BadLengthException('Container length should match array length.');
        }

        switch ($this->getStringable($what))
        {
            case 'keys':
                return new static(array_combine($array, $this->values()->all()));
            case 'values':
                return new static(array_combine($this->keys()->all(), $array));
            default:
                throw new BadMethodCallException('Argument 2 must be string or Stringable (keys or values)');
        }
    }
public function combine($array, $what = 'keys')
    {
        $array = $this->retrieveValue($array);

        if (count($array) !== $this->length())
        {
            throw new BadLengthException('Container length should match array length.');
        }

        switch ($this->getStringable($what))
        {
            case 'keys':
                return new static(array_combine($array, $this->values()->all()));
            case 'values':
                return new static(array_combine($this->keys()->all(), $array));
            default:
                throw new BadMethodCallException('Argument 2 must be string or Stringable (keys or values)');
        }
    }
Combine values from $array.
You can specify what to combine 'keys' or 'values' with the second argument.

@param mixed $array
@param string|StringContract $what
@return static
@throws BadMethodCallException
@throws BadLengthException