Skip to content

Commit 4128cbe

Browse files
xcaptainErickTamayo
authored andcommitted
chain values method in map function (ErickTamayo#66)
In ```php collect($results['hits']['hits'])->map(function ($hit) use ($model, $models) { return isset($models[$hit['_id']]) ? $models[$hit['_id']] : null; })->filter(); ``` would generate some holds which would cause `paginate` results objects rather than list.
1 parent 929184d commit 4128cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ElasticsearchEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function map($results, $model)
203203

204204
return collect($results['hits']['hits'])->map(function ($hit) use ($model, $models) {
205205
return isset($models[$hit['_id']]) ? $models[$hit['_id']] : null;
206-
})->filter();
206+
})->filter()->values();
207207
}
208208

209209
/**

0 commit comments

Comments
 (0)