1 |
cb15593b
|
Cajova-Houba
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace Illuminate\Pagination;
|
4 |
|
|
|
5 |
|
|
use Illuminate\Support\ServiceProvider;
|
6 |
|
|
|
7 |
|
|
class PaginationServiceProvider extends ServiceProvider
|
8 |
|
|
{
|
9 |
|
|
/**
|
10 |
|
|
* Register the service provider.
|
11 |
|
|
*
|
12 |
|
|
* @return void
|
13 |
|
|
*/
|
14 |
|
|
public function register()
|
15 |
|
|
{
|
16 |
|
|
Paginator::currentPathResolver(function () {
|
17 |
|
|
return $this->app['request']->url();
|
18 |
|
|
});
|
19 |
|
|
|
20 |
|
|
Paginator::currentPageResolver(function ($pageName = 'page') {
|
21 |
|
|
$page = $this->app['request']->input($pageName);
|
22 |
|
|
|
23 |
|
|
if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
|
24 |
|
|
return $page;
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
return 1;
|
28 |
|
|
});
|
29 |
|
|
}
|
30 |
|
|
}
|