jqh 4 年之前
父節點
當前提交
3b0cd0280b
共有 2 個文件被更改,包括 7 次插入7 次删除
  1. 3 3
      src/Grid/ColumnSelector/CacheStore.php
  2. 4 4
      src/Grid/ColumnSelector/SessionStore.php

+ 3 - 3
src/Grid/ColumnSelector/CacheStore.php

@@ -15,16 +15,16 @@ class CacheStore extends SessionStore
 
     public function store(array $input)
     {
-        $this->driver->put($this->getVisibleColumnsKey(), $input, $this->ttl);
+        $this->driver->put($this->getKey(), $input, $this->ttl);
     }
 
     public function get()
     {
-        return $this->driver->get($this->getVisibleColumnsKey());
+        return $this->driver->get($this->getKey());
     }
 
     public function forget()
     {
-        $this->driver->forget($this->getVisibleColumnsKey());
+        $this->driver->forget($this->getKey());
     }
 }

+ 4 - 4
src/Grid/ColumnSelector/SessionStore.php

@@ -20,20 +20,20 @@ class SessionStore implements ColumnSelectorStore
 
     public function store(array $input)
     {
-        session()->put($this->getVisibleColumnsKey(), $input);
+        session()->put($this->getKey(), $input);
     }
 
     public function get()
     {
-        return session()->get($this->getVisibleColumnsKey());
+        return session()->get($this->getKey());
     }
 
     public function forget()
     {
-        session()->remove($this->getVisibleColumnsKey());
+        session()->remove($this->getKey());
     }
 
-    protected function getVisibleColumnsKey()
+    protected function getKey()
     {
         return $this->grid->getName().'/'.request()->path().'/'.Admin::user()->getKey();
     }