Skip to content

Commit

Permalink
Remove relationship check
Browse files Browse the repository at this point in the history
  • Loading branch information
TitasGailius committed Jul 16, 2021
1 parent 7a1208a commit 46b9e83
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/Searches/RelationSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,13 @@ public function __construct(array $columns)
*/
public function apply(Builder $query, string $relation, string $search): Builder
{
$this->ensureRelationshipExists($query, $relation);

$query->orWhereHas($relation, function ($query) use ($relation, $search) {
return $this->columnSearch()->apply($query, $relation, $search);
});

return $query;
}

/**
* Ensure that the specified relationship exists.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $relation
* @return void
*/
protected function ensureRelationshipExists(Builder $query, string $relation)
{
$query->getRelation($relation);
}

/**
* Apply column search.
*
Expand Down

0 comments on commit 46b9e83

Please sign in to comment.