From 63f86ca0196b5a0189873638399a4cd1ae920717 Mon Sep 17 00:00:00 2001 From: Shane Deakin Date: Tue, 13 Mar 2018 13:51:19 +0000 Subject: [PATCH] Fix bindings on a polymorphic join Remove the binding from the join as it was being added in the wrong order to the query. --- src/SearchableTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchableTrait.php b/src/SearchableTrait.php index a3db5ca..99a4e2e 100644 --- a/src/SearchableTrait.php +++ b/src/SearchableTrait.php @@ -181,7 +181,7 @@ protected function makeJoins(Builder $query) $query->leftJoin($table, function ($join) use ($keys) { $join->on($keys[0], '=', $keys[1]); if (array_key_exists(2, $keys) && array_key_exists(3, $keys)) { - $join->where($keys[2], '=', $keys[3]); + $join->whereRaw($keys[2] . ' = "' . $keys[3] . '"'); } }); }