Skip to content
This repository was archived by the owner on Jul 31, 2018. It is now read-only.

Commit 2254580

Browse files
committed
Update EloquentSubscriber.php
In order to properly delete an object from Algolia, the subscriber must use the $model->getObjectId() method to account for tables that have primary keys labeled something other than "id". For example, "user_id".
1 parent 2c73d99 commit 2254580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EloquentSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function deleted($model)
3535

3636
/** @var \AlgoliaSearch\Index $index */
3737
foreach ($this->modelHelper->getIndices($model) as $index) {
38-
$index->deleteObject($model->id);
38+
$index->deleteObject($model->getObjectId());
3939
}
4040

4141
return true;

0 commit comments

Comments
 (0)