Browse Source

兼容低版本Laravel withQueryString

jqh 4 năm trước cách đây
mục cha
commit
af4bf2e594
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      src/Grid/Model.php

+ 7 - 1
src/Grid/Model.php

@@ -484,7 +484,13 @@ class Model
     {
         $this->paginator = $paginator;
 
-        $paginator->withQueryString();
+        if ($this->simple) {
+            if (method_exists($paginator, 'withQueryString')) {
+                $paginator->withQueryString();
+            } else {
+                $paginator->appends(request()->all());
+            }
+        }
 
         $paginator->setPageName($this->getPageName());
     }