Add additional details to a collections.

@param collection $collectionItems

@return collection
179678
private function mapAdditionalDetails($collectionItems)
    {
        $collectionItems->map(function ($collectionItem) {
            $eventTime = Carbon::parse($collectionItem->updated_at);
            $collectionItem['timePassed'] = $eventTime->diffForHumans();
            $collectionItem['userAgentDetails'] = UserAgentDetails::details($collectionItem->useragent);
            $collectionItem['langDetails'] = UserAgentDetails::localeLang($collectionItem->locale);
            $collectionItem['userDetails'] = config('LaravelLogger.defaultUserModel')::find($collectionItem->userId);

            return $collectionItem;
        });

        return $collectionItems;
    }
219022
private function addItem()
    {
        $args = func_get_args();
        $this->items[$args[0]] = implode(':', array_slice($args, 1));

        return $this;
    }
57214
protected function convertItems($items)
    {
        $convertedItems = new Collection();

        foreach ($items as $item) {
            $convertedItems->add(new ItemContainer($item));
        }

        return $convertedItems;
    }
690878
protected function setCartItems($items)
    {
        return (new Collection($items))->map(function ($item, $num) {
            return [
                'L_PAYMENTREQUEST_0_NAME'.$num => $item['name'],
                'L_PAYMENTREQUEST_0_AMT'.$num  => $item['price'],
                'L_PAYMENTREQUEST_0_QTY'.$num  => isset($item['qty']) ? $item['qty'] : 1,
            ];
        })->flatMap(function ($value) {
            return $value;
        });
    }
759337
public function collection($collectionId)
    {
        return new CollectionReference(
            $this->connection,
            $this->valueMapper,
            $this->childPath($this->name, $collectionId)
        );
    }
74071
public function addCollection(RequirementCollection $collection)
    {
        $this->requirements = array_merge($this->requirements, $collection->all());
    }
1035194
public function createFromCollection(Collection $collection)
    {
        $this->operator = new CollectionOperator($collection, $this->request);
        $this->prepare();

        return $this;
    }
139263
public function addSchemaCollection($collectionName, $schemas)
    {
        $this->schemaCollections[$collectionName] = [];

        foreach ($schemas as $schemaName => $schema) {
            $this->addSchema($collectionName, $schemaName, $schema);
        }
    }
516939
public function collection(Collection $collection)
    {
        $entries = new Entries();

        foreach ($collection as $product) {
            $entry = new Entry($product);

            $entry
                ->field('id')
                ->field('name')
                ->field('description')
                ->field('sku')
                ->field('status')
                ->field('price')
                ->field('sale_price')
                ->field('quantity')

                ->value('image', $product->product->defaultImage())
                // ->relationshipField('product', 'Subbly\\Presenter\\V1\\ProductPresenter')

                ->dateField('created_at')
                ->dateField('updated_at')
            ;

            $entries->addEntry($entry);
        }

        return $entries->toArray();
    }
773822
protected function updateCollectionItem()
    {
        $this->controlAccess('collection_item_edit');

        if ($this->collection_item->update($this->data_collection_item['collection_item_id'], $this->getSubmitted())) {
            $url = "admin/content/collection-item/{$this->data_collection['collection_id']}";
            $this->redirect($url, $this->text('Collection item has been updated'), 'success');
        }

        $this->redirect('', $this->text('Collection item has not been updated'), 'warning');
    }
1221417
public function merge(CollectionInterface ...$collections): CollectionInterface
    {
        $temp = [$this->data];

        foreach ($collections as $index => $collection) {
            if (!$collection instanceof static) {
                throw new CollectionMismatchException(
                    \sprintf('Collection with index %d must be of type %s', $index, static::class)
                );
            }

            $temp[] = $collection->toArray();
        }

        return new static(\array_merge(...$temp));
    }
711775
public function addMany($items, $prepend = false)
    {
        $this->emitOnChange(__METHOD__);
        if ($prepend) {
            # if items must be added to beginning, we need to reverse them
            if (!is_array($items)) {
                $items = iterator_to_array($items);
            }
            $items = array_reverse($items);
        }
        foreach ($items as $item) {
            $this->add($item, $prepend);
        }
        $this->endEmitOnChange(__METHOD__);
        return $this;
    }
255060
public boolean addItems(Collection<? extends T> items) {
        if (mListItems.addAll(items)) {
            notifyDataSetChanged();
            return true;
        }
        return false;
    }
238285
public function setItems($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addBody($items);

        return $this;
    }
973427
public function addMyFriends(Collection $users)
    {
        foreach ($users as $user) {
            $this->addMyFriend($user);
        }

        return $this;
    }
891717
public function addAll(array $elements)
    {
        if (is_array($elements)) {
            foreach ($elements as $element) {
                $this->_items[] = $element;
            }
            $this->_iterator = null;
        } else {
            throw new CollectionException('Given array can not added to collection, because it is no array.', E_NOTICE);
        }
    }
385736
public function addManagedCollections($collections)
    {
        if (!is_array($collections)) {
            $collections = array($collections);
        }
        $this->managedCollections = array_merge($this->managedCollections, $collections);

        return $this;
    }