Skip to content

Commit ea5bae0

Browse files
Merge pull request #31 from Naoray/fixes-scout-not-returning-results
fix not returning results for scout mixin
2 parents 424aa0f + d33e65c commit ea5bae0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/ScoutMixin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function fastPaginate($perPage = null, $pageName = 'page', $page = null)
1111
{
1212
return function ($perPage = null, $pageName = 'page', $page = null) {
1313
// Just defer to the Scout Builder for DX purposes.
14-
$this->paginate($perPage, $pageName, $page);
14+
return $this->paginate($perPage, $pageName, $page);
1515
};
1616
}
1717
}

tests/Integration/ScoutTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ class ScoutTest extends BaseTest
1313
public function basic_scout_test()
1414
{
1515
$queries = $this->withQueriesLogged(function () {
16-
UserScout::search('Person')->paginate();
17-
UserScout::search('Person')->fastPaginate();
16+
$results1 = UserScout::search('Person')->paginate();
17+
$results2 = UserScout::search('Person')->fastPaginate();
18+
19+
$this->assertEquals($results1->count(), $results2->count());
1820
});
1921

2022
$this->assertEquals(

0 commit comments

Comments
 (0)