Use the custom collection that allows tapping.

@param array $models An array of models to turn into a collection.

@return \Illuminate\Database\Eloquent\Collection OR \JumpGate\Database\Collections\EloquentCollection
421775
public function newCollection(array $models = [])
    {
        if (app(config('auth.providers.users.model'))->jumpGateCollections) {
            return new EloquentCollection($models);
        }

        return parent::newCollection($models);
    }
1019227
protected function loadWiths(array $models) {
        if ($models && $this->_with) {
            foreach ($this->_with as $w) {
                /** @var BatchLoader $loader */
                $loader = $w['loader'];
                $subWith = $w['with'];
                $loader->batchLoadFor($models, $subWith);
            }
            $this->_with = [];
        }
        return $models;
    }
872906
protected function run($models)
    {
        $models = collect($models);
        if ($models->count() > 0) {
            $model = $models->first();

            if (!is_object($model)) {
                return;
            }

            if (!$this->isCascadable($model)) {
                return;
            }

            if (!in_array($model->getConnectionName(), $this->dbsToTransact)) {
                $this->dbsToTransact[] = $model->getConnectionName();
                DB::connection($model->getConnectionName())->beginTransaction();
            }

            $this->relations($model, $models->pluck($model->getKeyName()));
        }
    }
866569
public function skip(int $step): ArrayCollection
    {
        $items = [];
        $pos = 0;

        foreach ($this->items as $key => $value) {
            if ($pos % $step === 0) {
                $items[$key] = $value;
            }
            $pos++;
        }

        return new static($items);
    }
402852
protected function buildDictionary(Collection $models)
    {
        foreach ($models as $model) {
            if ($model->{$this->morphType}) {
                $this->dictionary[$model->{$this->morphType}][$model->{$this->foreignKey}][] = $model;
            }
        }
    }
1152949
public function addToPersistModels(array $models): RelatedModelManipulationStack
    {
        foreach ($models as $model) {
            $this->addToPersistModel($model);
        }

        return $this;
    }
1365757
public function migrateModels($models)
    {
        // run inside callback
        $this->set(function ($c) use ($models) {
            $c->notice('Preparing to migrate models');
            $p = $c->app->db;

            foreach ($models as $model) {
                if (!is_object($model)) {
                    $model = $this->factory($model);
                    $p->add($model);
                }

                $m = new \atk4\schema\Migration\MySQL($model);
                $result = $m->migrate();

                $c->debug('  '.get_class($model).'.. '.$result);
            }

            $c->notice('Done with migration');
        });
    }
543553
public function get($columns = array('*'))
    {
        $models = $this->getModels($columns);

        if (count($models) > 0) {
            $models = $this->eagerLoadRelations($models);
        }

        return $this->model->newCollection($models);
    }
319673
protected static function buildMorphMapFromModels(array $models = null)
    {
        if (is_null($models) || array_is_assoc($models)) {
            return $models;
        }

        $tables = array_map(function ($model) {
            return (new $model)->getTable();
        }, $models);

        return array_combine($tables, $models);
    }
21519
public function handleModels(array $models)
    {
        $builder = $this->builder;

        $builder->start();

        foreach ($models as $model) {
            $languages = (array)(isset($model->sitemapLanguages) ? $model->sitemapLanguages : Yii::$app->language);

            if (count($languages) > 1) {
                // Handle separately for each language
                foreach ($languages as $language) {
                    // Swith App language to $language
                    if (isset($model->sitemapSwithLanguages) && $model->sitemapSwithLanguages) {
                        static::setLanguage($language);
                    }

                    $this->handleModel($model, $language);

                    // Restore App language
                    static::restoreLanguage();
                }
            } else {
                // Handle only one language
                $this->handleModel($model, null);
            }
        }

        $builder->finish();
    }
360108
public function addEagerConstraints(array $models)
    {
        /**
         * We'll grab the primary key name of the related models since it could be set to
         * a non-standard name and not "id". We will then construct the constraint for
         * our eagerly loading query so it returns the proper models from execution.
         */

        // Grab the parent node placeholder
        $parentNode = $this->query->getQuery()->modelAsNode($this->parent->getTable());

        // Tell the builder to select both models of the relationship
        $this->query->select($this->relation, $parentNode);

        // Setup for their mutation so they don't breed weird stuff like... humans ?!
        $this->query->addManyMutation($this->relation, $this->related);
        $this->query->addManyMutation($parentNode, $this->parent);

        // Set the parent node's placeholder as the RETURN key.
        $this->query->getQuery()->from = array($parentNode);
        // Build the MATCH ()-[]->() Cypher clause.
        $this->query->matchOut($this->parent, $this->related, $this->relation, $this->foreignKey, $this->localKey, $this->parent->{$this->localKey});
        // Add WHERE clause over the parent node's matching keys [values...].
        $this->query->whereIn($this->localKey, $this->getKeys($models));
    }
490296
public function addEagerConstraints(array $models)
    {
        $this->query->whereIn($this->getQualifiedForeignKeyName(), $this->getKeys($models));
    }
1374578
public static function buildTemplates($models)
    {
        $result = [];
        foreach($models as $model) {
            $result[] = self::buildTemplate($model);
        }

        return $result;
    }
883733
protected function fetchSnippetSourceFromModels($models)
    {
        if ($this->asArray) {
            throw new InvalidCallException('"' . __METHOD__ . '" unable to determine snippet source from plain array. Either disable "asArray" option or use regular "snippetCallback"');
        }
        $result = [];
        foreach ($models as $model) {
            $result[] = $model->getSnippetSource();
        }

        return $result;
    }
1066799
public function setModels($models)
    {
        if (!is_object($models)) {
            if (is_array($models)) {
                $models = collect($models);
            }
        }

        if(class_basename($models->first()) == 'stdClass')
        {
            $models = $models->map(function ($array) {
                return new BlankModel($array);
            });
        }

        $this->models = $models;
    }
666773
public function map($results, $model)
    {
        if (count($results['ids']) === 0) {
            return Collection::make();
        }

        $keys = collect($results['ids'])->values()->all();
        $fieldsWheres = array_keys($this->builder->wheres);
        $models = $model->whereIn(
            $model->getQualifiedKeyName(),
            $keys
        )->get()->keyBy($model->getKeyName());

        return collect($results['ids'])->map(function ($hit) use ($models) {
            return $models->has($hit) ? $models[$hit] : null;
        })->filter(function ($model) use ($fieldsWheres) {
            return ! is_null($model) && array_reduce($fieldsWheres, function ($carry, $item) use ($model) {
                return $carry && $model[$item] == $this->builder->wheres[$item];
            }, true);
            ;
        });
    }
746388
public function get($columns = ['*']) : Collection
    {
        // First we'll add the proper select columns onto the query so it is run with
        // the proper columns. Then, we will get the results and hydrate out pivot
        // models with the result of those columns as a separate model relation.
        $columns = $this->query->getQuery()->columns ? [] : $columns;

        $select = $this->getSelectColumns($columns);

        $entities = $this->query->addSelect($select)->disableCache()->get()->all();

        $entities = $this->hydratePivotRelation($entities);

        return $this->relatedMap->newCollection($entities);
    }