From d4b3f020c66cec8c676863ef523b2a25db0b5872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20L=C3=B3pez?= Date: Fri, 10 Oct 2014 13:24:43 -0300 Subject: [PATCH] Change join to left join MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Left join it’s necessary to keep in the results the rows that don’t have relations --- src/Nicolaslopezj/Searchable/SearchableTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nicolaslopezj/Searchable/SearchableTrait.php b/src/Nicolaslopezj/Searchable/SearchableTrait.php index e3ddc7e..00e98ff 100755 --- a/src/Nicolaslopezj/Searchable/SearchableTrait.php +++ b/src/Nicolaslopezj/Searchable/SearchableTrait.php @@ -63,7 +63,7 @@ protected function getJoins() { */ protected function makeJoins(&$query) { foreach ($this->getJoins() as $table => $keys) { - $query->join($table, $keys[0], '=', $keys[1]); + $query->leftJoin($table, $keys[0], '=', $keys[1]); } }