Skip to content

Commit

Permalink
Merge pull request #31 from Naoray/fixes-scout-not-returning-results
Browse files Browse the repository at this point in the history
fix not returning results for scout mixin
  • Loading branch information
aarondfrancis authored Aug 15, 2022
2 parents 424aa0f + d33e65c commit ea5bae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ScoutMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function fastPaginate($perPage = null, $pageName = 'page', $page = null)
{
return function ($perPage = null, $pageName = 'page', $page = null) {
// Just defer to the Scout Builder for DX purposes.
$this->paginate($perPage, $pageName, $page);
return $this->paginate($perPage, $pageName, $page);
};
}
}
6 changes: 4 additions & 2 deletions tests/Integration/ScoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class ScoutTest extends BaseTest
public function basic_scout_test()
{
$queries = $this->withQueriesLogged(function () {
UserScout::search('Person')->paginate();
UserScout::search('Person')->fastPaginate();
$results1 = UserScout::search('Person')->paginate();
$results2 = UserScout::search('Person')->fastPaginate();

$this->assertEquals($results1->count(), $results2->count());
});

$this->assertEquals(
Expand Down

0 comments on commit ea5bae0

Please sign in to comment.