Skip to content

Commit 7fe1571

Browse files
committed
fix: broken functionality if soft_delete is set to true
This commit fixes the broken functionality ("undefined column __soft_deleted") when soft_delete is set to true in scout.php config. The reason for this is the change in behavior of in_array from PHP 7 to 8. Specifically, in PHP 7, in_array($aKeyThatExists, $singleDimensionalArray) returns TRUE, but the same call in PHP 8 would return FALSE). This fixes #318.
1 parent 07607a1 commit 7fe1571

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Engines/TNTSearchEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ private function handleSoftDeletes($builder, $model)
352352
*
353353
* When no __soft_deleted statement is given return all entries
354354
*/
355-
if (!in_array('__soft_deleted', $this->builder->wheres)) {
355+
if (!array_key_exists('__soft_deleted', $this->builder->wheres)) {
356356
return $builder->withTrashed();
357357
}
358358

0 commit comments

Comments
 (0)