1 <?php namespace BookStack\Providers;
4 use Illuminate\Support\ServiceProvider;
5 use Illuminate\Pagination\Paginator;
7 class PaginationServiceProvider extends ServiceProvider
10 * Register the service provider.
14 public function register()
16 Paginator::currentPathResolver(function () {
17 return baseUrl($this->app['request']->path());
20 Paginator::currentPageResolver(function ($pageName = 'page') {
21 $page = $this->app['request']->input($pageName);
23 if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {