Skip to content

Commit b25f757

Browse files
authored
Support for full text search
Recently Laravel added support for full-text search where clauses in the query builder. https://laravel.com/docs/9.x/queries#full-text-where-clauses Looks like using that functionality with this package throws an error in line 240 of CacheKey.php because it didn't properly handle that where clause. This pull request makes a few changes to support full-text where clauses.
1 parent 464f119 commit b25f757

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/CacheKey.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ protected function getOtherClauses(array $where) : string
177177
$value = $this->getTypeClause($where);
178178
$value .= $this->getValuesClause($where);
179179

180-
return "-{$where["column"]}_{$value}";
180+
$column = "";
181+
$column .= isset($where["column"]) ? $where["column"] : "";
182+
$column .= isset($where["columns"]) ? implode("-", $where["columns"]) : "";
183+
184+
return "-{$column}_{$value}";
181185
}
182186

183187
protected function getQueryColumns(array $columns) : string
@@ -231,7 +235,7 @@ protected function getTableSlug() : string
231235

232236
protected function getTypeClause($where) : string
233237
{
234-
$type = in_array($where["type"], ["InRaw", "In", "NotIn", "Null", "NotNull", "between", "NotInSub", "InSub", "JsonContains"])
238+
$type = in_array($where["type"], ["InRaw", "In", "NotIn", "Null", "NotNull", "between", "NotInSub", "InSub", "JsonContains", "Fulltext"])
235239
? strtolower($where["type"])
236240
: strtolower($where["operator"]);
237241

0 commit comments

Comments
 (0)