mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 02:10:19 +08:00
9dc9724e15
* Started move to laravel 5.3 * Started updating login & registration flows for laravel 5.3 update * Updated app emails to notification system * Fixed registations bugs and removed email confirmation model * Fixed large portion of laravel post-upgrade issues * Fixed and tested LDAP process
35 lines
903 B
PHP
35 lines
903 B
PHP
<?php namespace BookStack\Providers;
|
|
|
|
|
|
use Illuminate\Pagination\PaginationServiceProvider as IlluminatePaginationServiceProvider;
|
|
use Illuminate\Pagination\Paginator;
|
|
|
|
class PaginationServiceProvider extends IlluminatePaginationServiceProvider
|
|
{
|
|
|
|
/**
|
|
* Register the service provider.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
Paginator::viewFactoryResolver(function () {
|
|
return $this->app['view'];
|
|
});
|
|
|
|
Paginator::currentPathResolver(function () {
|
|
return baseUrl($this->app['request']->path());
|
|
});
|
|
|
|
Paginator::currentPageResolver(function ($pageName = 'page') {
|
|
$page = $this->app['request']->input($pageName);
|
|
|
|
if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
|
|
return $page;
|
|
}
|
|
|
|
return 1;
|
|
});
|
|
}
|
|
} |