@@ -94,18 +94,18 @@ abstract class AbstractPaginator implements Htmlable
94
94
protected static $ currentPageResolver ;
95
95
96
96
/**
97
- * The view factory resolver callback.
97
+ * The query string resolver callback.
98
98
*
99
99
* @var \Closure
100
100
*/
101
- protected static $ viewFactoryResolver ;
101
+ protected static $ queryStringResolver ;
102
102
103
103
/**
104
- * The with query string resolver callback.
104
+ * The view factory resolver callback.
105
105
*
106
106
* @var \Closure
107
107
*/
108
- protected static $ queryStringResolver ;
108
+ protected static $ viewFactoryResolver ;
109
109
110
110
/**
111
111
* The default pagination view.
@@ -223,29 +223,29 @@ public function appends($key, $value = null)
223
223
}
224
224
225
225
/**
226
- * Add all query string values to the paginator .
226
+ * Add an array of query string values.
227
227
*
228
+ * @param array $keys
228
229
* @return $this
229
230
*/
230
- public function withQueryString ( )
231
+ protected function appendArray ( array $ keys )
231
232
{
232
- if ( isset ( static :: $ queryStringResolver ) ) {
233
- return $ this ->appends ( call_user_func ( static :: $ queryStringResolver ) );
233
+ foreach ( $ keys as $ key => $ value ) {
234
+ $ this ->addQuery ( $ key , $ value );
234
235
}
235
236
236
237
return $ this ;
237
238
}
238
239
239
240
/**
240
- * Add an array of query string values.
241
+ * Add all current query string values to the paginator .
241
242
*
242
- * @param array $keys
243
243
* @return $this
244
244
*/
245
- protected function appendArray ( array $ keys )
245
+ public function withQueryString ( )
246
246
{
247
- foreach ( $ keys as $ key => $ value ) {
248
- $ this ->addQuery ( $ key , $ value );
247
+ if ( isset ( static :: $ queryStringResolver ) ) {
248
+ return $ this ->appends ( call_user_func ( static :: $ queryStringResolver ) );
249
249
}
250
250
251
251
return $ this ;
@@ -484,6 +484,17 @@ public static function currentPageResolver(Closure $resolver)
484
484
static ::$ currentPageResolver = $ resolver ;
485
485
}
486
486
487
+ /**
488
+ * Set with query string resolver callback.
489
+ *
490
+ * @param \Closure $resolver
491
+ * @return void
492
+ */
493
+ public static function queryStringResolver (Closure $ resolver )
494
+ {
495
+ static ::$ queryStringResolver = $ resolver ;
496
+ }
497
+
487
498
/**
488
499
* Get an instance of the view factory from the resolver.
489
500
*
@@ -505,17 +516,6 @@ public static function viewFactoryResolver(Closure $resolver)
505
516
static ::$ viewFactoryResolver = $ resolver ;
506
517
}
507
518
508
- /**
509
- * Set with query string resolver callback.
510
- *
511
- * @param \Closure $resolver
512
- * @return void
513
- */
514
- public static function withQueryStringResolver (Closure $ resolver )
515
- {
516
- static ::$ queryStringResolver = $ resolver ;
517
- }
518
-
519
519
/**
520
520
* Set the default pagination view.
521
521
*
0 commit comments