From 8fe1ffb7047a987b4eea0873b4c90a6c3ab125c5 Mon Sep 17 00:00:00 2001 From: freek Date: Mon, 30 Oct 2017 11:53:35 +0100 Subject: [PATCH] nitpicks --- .styleci.yml | 2 -- CHANGELOG.md | 3 +++ src/PaginateRoute.php | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.styleci.yml b/.styleci.yml index 916d27e..0285f17 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,3 +1 @@ preset: laravel - -linting: true diff --git a/CHANGELOG.md b/CHANGELOG.md index a97481c..8b867ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to `spatie/laravel-paginateroute` will be documented in this file. +## 2.6.0 - 2017-10-30 +- preserve query string on pagination urls + ## 2.5.0 - 2017-05-15 - add support for Arabic diff --git a/src/PaginateRoute.php b/src/PaginateRoute.php index d17200a..bfc68c9 100644 --- a/src/PaginateRoute.php +++ b/src/PaginateRoute.php @@ -8,6 +8,7 @@ use Illuminate\Contracts\Pagination\Paginator; use Illuminate\Contracts\Routing\UrlGenerator; use Illuminate\Contracts\Pagination\LengthAwarePaginator; +use Request; class PaginateRoute { @@ -301,9 +302,11 @@ public function pageUrl($page, $full = false) $url = str_replace(['{'.$parameterName.'}', '{'.$parameterName.'?}'], $parameterValue, $url); } - $query = \Request::getQueryString(); + $query = Request::getQueryString(); - return $this->urlGenerator->to($url).($query ? '?'.$query : ''); + return $this->urlGenerator->to($url).$query + ? '?'.$query + : ''; } /**