Skip to content

Commit

Permalink
Update Observer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
HammamSamara committed Jan 13, 2016
1 parent ee0f0f3 commit c2c26bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Iverberk/Larasearch/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public function deleting(Model $model)
{
// Delete corresponding $model document from Elasticsearch
Queue::connection('elastic-search')->push('Workers\ElasticDeleteJob', get_class($model) . ':' . $model->getKey());
// Update all related model documents to reflect that $model has been removed
Queue::connection('elastic-search')->push('Iverberk\Larasearch\Jobs\ReindexJob', $this->findAffectedModels($model, true));
}

/**
Expand Down

0 comments on commit c2c26bf

Please sign in to comment.