Skip to content

Commit b947894

Browse files
committed
Update laravel scout version
1 parent 1b94f76 commit b947894

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"illuminate/contracts": "~5.3",
2525
"illuminate/database": "~5.3",
2626
"illuminate/support": "~5.3",
27-
"laravel/scout": "^1.0"
27+
"laravel/scout": "^2.0"
2828
},
2929
"require-dev": {
3030
"phpunit/phpunit": "5.*",

src/PostgresEngine.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ protected function performSearch(Builder $builder, $perPage = 0, $page = 1)
224224
->select($query->toSql(), $bindings->all());
225225
}
226226

227+
public function mapIds($results)
228+
{
229+
return collect($results)->pluck('id')->values()->all();
230+
}
231+
227232
/**
228233
* Map the given results to instances of the given model.
229234
*
@@ -238,11 +243,8 @@ public function map($results, $model)
238243
}
239244

240245
$results = collect($results);
241-
242-
$keys = $results
243-
->pluck($model->getKeyName())
244-
->values()
245-
->all();
246+
247+
$keys = $this->mapIds($results);
246248

247249
$models = $model->whereIn($model->getKeyName(), $keys)
248250
->get()

0 commit comments

Comments
 (0)