-
app/Traits/Modules.php
Open in GitHubuse Cache; use Date; trait Modules { // public function getModules($data = []) { $key = 'apps.app.' . $this->getDataKeyOfModules($data); $items = Cache::get($key); if (!empty($items)) { return $items; } $items = static::getResponseData('GET', 'apps/items'); Cache::put($key, $items, Date::now()->addHour()); return $items; } // }