Skip to content

Commit 4234f3d

Browse files
Check for HasManyDeep in applySearchConstraint method (#19531)
* Check for HasManyDeep in applySearchConstraint method * Update InteractsWithTableQuery.php --------- Co-authored-by: Dan Harrin <git@danharrin.com>
1 parent b339564 commit 4234f3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/tables/src/Columns/Concerns/InteractsWithTableQuery.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
88
use Illuminate\Database\Eloquent\Relations\Relation;
99
use Illuminate\Support\Arr;
10+
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
1011
use Znck\Eloquent\Relations\BelongsToThrough;
1112

1213
use function Filament\Support\generate_search_column_expression;
@@ -95,7 +96,7 @@ function (EloquentBuilder $query) use ($model, $whereClause, $searchColumn, $isS
9596

9697
$relatedTable = $model->getTable();
9798

98-
if ($relationship instanceof BelongsToThrough) {
99+
if (($relationship instanceof BelongsToThrough) || ($relationship instanceof HasManyDeep)) {
99100
$relatedTable = $relationship->getRelated()->getTable();
100101
$searchColumn = str($searchColumn)->startsWith("{$relatedTable}.")
101102
? $searchColumn

0 commit comments

Comments
 (0)