]> _ Git - cubist_cms-back.git/commitdiff
wip #3546 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Apr 2020 15:10:31 +0000 (17:10 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Apr 2020 15:10:31 +0000 (17:10 +0200)
composer.json
src/app/Magic/Fields/Model.php

index 741a7db679a0a2ea6f663e810a4bd0523567d4d1..8755efccb30c850f92115f475e4ddadd72918204 100644 (file)
@@ -44,7 +44,8 @@
         "cviebrock/laravel-elasticsearch": "^4.2",
         "spatie/laravel-honeypot": "^2.1",
         "chrisjean/php-ico": "^1.0",
-        "swayok/alternative-laravel-cache": "^5.4"
+        "swayok/alternative-laravel-cache": "^5.4",
+        "genealabs/laravel-model-caching": "^0.8.0"
     },
     "require-dev": {
         "filp/whoops": "^2.7",
index e7829959f53ccda87170428e78237c95ba0c365c..81bc504d738887ef3de8dc6e686c03ee42374c71 100644 (file)
@@ -30,7 +30,9 @@ class Model extends Field
         $inst = new $modelClass();
 
         $attr = $this->getAttribute('attribute');
-        return $modelClass::orderBy($attr)->get()->pluck($attr, $inst->getKeyName())->toArray();
+        $options = $modelClass::all();
+
+        return $options->pluck($attr, $inst->getKeyName())->toArray();
     }
 
     public function getDatabaseType()