Ver Fonte

兼容低版本Laravel withQueryString

jqh há 4 anos atrás
pai
commit
af4bf2e594
1 ficheiros alterados com 7 adições e 1 exclusões
  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());
     }