Skip to content

Commit 37cb150

Browse files
authored
Merge pull request #415 from spencer-leopold/master
Use Paginator to resolve current page.
2 parents b8ffa34 + 7bd18b3 commit 37cb150

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Traits/Buildable.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php namespace GeneaLabs\LaravelModelCaching\Traits;
22

3-
use Illuminate\Container\Container;
3+
use Illuminate\Pagination\Paginator;
44

55
/**
66
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
@@ -153,11 +153,7 @@ public function paginate(
153153
return parent::paginate($perPage, $columns, $pageName, $page);
154154
}
155155

156-
$page = Container::getInstance()
157-
->make("request")
158-
->input($pageName)
159-
?: $page
160-
?: 1;
156+
$page = $page ?: Paginator::resolveCurrentPage($pageName);
161157

162158
if (is_array($page)) {
163159
$page = $this->recursiveImplodeWithKey($page);

0 commit comments

Comments
 (0)