fly 4 年之前
父節點
當前提交
8bf69a1913
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Controllers/BaseControllerConfig.php

+ 3 - 1
src/Controllers/BaseControllerConfig.php

@@ -24,11 +24,13 @@ use Illuminate\Database\Eloquent\Model;
  */
 trait BaseControllerConfig
 {
+    private $field = [];
     public function __get($name)
     {
         if (!isset($this->field[$name])) {
-            return $this->$name();
+            $this->field[$name] = $this->$name();
         }
+        return $this->field[$name];
     }
 
     protected function channel(): Model