Remove the given model from the index.

@param  \Illuminate\Database\Eloquent\Collection $models
@return void
962212
public function delete($models)
    {
        $model = $models->first();

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

        $indexColumn = $this->getIndexColumn($model);
        $key = $model->getKeyName();

        $ids = $models->pluck($key)->all();

        $this->database
            ->table($model->searchableAs())
            ->whereIn($key, $ids)
            ->update([$indexColumn => null]);
    }
1335674
protected function processAllAttachments(Collection $models)
    {
        $progress = $this->getProgressBar($models);
        $progress->start();

        foreach ($models as $model) {
            $progress->advance();

            foreach ($model->getAttachedFiles() as $attachedFile) {
                $attachedFile->reprocess();
            }
        }

        $progress->finish();
    }
357686
public function remove(Builder $builder, Model $model)
    {
        $query = $builder->getQuery();

        if (is_null($query->wheres)) {
            return;
        }

        $bindingKey = 0;

        $scopeConstraints = $this->getScopeConstraints($model);

        foreach ((array) $query->wheres as $key => $where) {
            $bindingsCount = $this->countBindings($where);

            if (in_array($where, $scopeConstraints)) {
                $this->removeWhere($query, $key);

                $this->removeBindings($query, $bindingKey, $bindingsCount);
            } else {
                $bindingKey += $bindingsCount;
            }
        }

        $query->wheres = array_values($query->wheres);
    }
147563
public function removeAll()
    {
        foreach ($this->_associated_objects as $parent_property => $object) {
            /**
             * @var Model
             */
            $object->setDirty($parent_property);
        }
        $this->exchangeArray([]);
    }
579147
public function deleting(Model $model)
    {
        $model->deleted_by = $this->guard->check() ? $this->guard->user()->getId() : null;
    }
833499
public function collections(array $collections) : void {
        foreach ($collections as $name => $callback) {
            $this->make($name, $callback);
        }
    }
565530
public function remove(Model $object)
    {
        foreach ($this as $index => $item) {
            if ($item === $object) {
                $this->removeAt($index);
            }
        }
    }
514393
public function update($models)
    {
        $params['body'] = [];

        $models->each(function($model) use (&$params)
        {
            $params['body'][] = [
                'update' => [
                    '_id' => $model->getKey(),
                    '_index' => $this->index,
                    '_type' => $model->searchableAs(),
                ]
            ];
            $params['body'][] = [
                'doc' => $model->toSearchableArray(),
                'doc_as_upsert' => true
            ];
        });

        $this->elastic->bulk($params);
    }
962573
public function removeAt($index)
    {
        if (isset($this[$index])) {
            foreach ($this->_associated_objects as $parent_property => $object) {
                /**
                 * @var Model
                 */
                $object->setDirty($parent_property);
            }
            unset($this[$index]);
        }
    }
674450
public static function remove($index)
    {
        if (isset(self::$views[$index])) {
            self::$views[$index] = null;
        }
    }
295574
public function cleanup(Model $model) {
        if ($model->id) {
            $this->resetCache($model, $model->id);
        }

        foreach ($this->_cached as $key => $value) {
            $this->deleteCache($model, $key);
        }
    }
1322977
public function deleteCache(Model $model, $keys) {
        $key = $this->cacheKey($model, $keys);

        unset($this->_cached[$key]);

        return Cache::delete($key, $this->settings[$model->alias]['cacheConfig']);
    }
641388
public function removeByIndex($indices)
    {
        if (!is_array($indices)) {
            $indices = array($indices);
        }

        $indices = array_unique($indices);

        $allItems = $this->getAll();
        foreach ($indices as $index) {
            unset($allItems[$index]);
        }

        $this->setAll(array_values($allItems));
    }
481478
public function deleted($model)
    {
        $translationRepository = \App::make(TranslationRepository::class);
        foreach ($model->translatableAttributes() as $attribute) {
            $translationRepository->deleteByCode($model->translationCodeFor($attribute));
        }
    }
860160
protected function drop($tables, bool $ignoreKeyConstraints = false) : void
    {
        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=0;');
        }

        if (! is_array($tables)) {
            $tables = [$tables];
        }

        foreach ($tables as $table) {
            if ($this->tableExists($table)) {
                $this->schema->drop($table);
            }
        }

        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=1;');
        }
    }
919851
public function addEagerConstraints(array $models)
    {
        parent::addEagerConstraints($models);

        $this->query->where($this->table.'.'.$this->morphType, $this->morphClass);
    }
1186126
public function delete()
    {
        if ($this->isNewRecord()) {
            throw new DeleteModelException("New models can't be deleted.");
        }

        $this->beforeDelete();
        $this->raiseEvent("BeforeDelete");

        $this->Deleted = true;
        $this->save();

        $this->afterDelete();
        $this->raiseEvent("AfterDelete");
    }