src/Helper/Collection.php
public function implode($value, $glue = null)
    {
        $new_collection = new Collection($this->toArray());
        $first = $new_collection->first();

        if (is_array($first) || is_object($first)) {
            return implode($glue, $new_collection->pluck($value)->all());
        }

        return implode($value, $new_collection->all());
    }
public function implode($value, $glue = null)
    {
        $new_collection = new Collection($this->toArray());
        $first = $new_collection->first();

        if (is_array($first) || is_object($first)) {
            return implode($glue, $new_collection->pluck($value)->all());
        }

        return implode($value, $new_collection->all());
    }
Concatenate values of a given key as a string.

@param  string  $value
@param  string  $glue
@return string