Skip to content

Commit

Permalink
fix: circumvent queue when using aggregators (#287)
Browse files Browse the repository at this point in the history
* fix: circumvent queue when using aggregators

* chore: remove unused import
  • Loading branch information
DevinCodes authored Feb 23, 2022
1 parent 9097d1a commit b2dc355
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Searchable/Aggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ public function newCollection(array $searchables = []): Collection
return new Collection($searchables);
}

/**
* Dispatch the job to make the given models unsearchable.
*
* @param \Illuminate\Database\Eloquent\Collection $models
* @return void
*/
public function queueRemoveFromSearch($models)
{
if ($models->isEmpty()) {
return;
}

$models->first()->searchableUsing()->delete($models);
}

/**
* Handle dynamic method calls into the model.
*
Expand Down

0 comments on commit b2dc355

Please sign in to comment.