From 2fb916c22b9f97133140d53c801afc76a8ede38e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 31 Aug 2021 00:37:28 -0600 Subject: [PATCH] Update InstanceService --- app/Services/InstanceService.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Services/InstanceService.php b/app/Services/InstanceService.php index 8b504d77f..48117d159 100644 --- a/app/Services/InstanceService.php +++ b/app/Services/InstanceService.php @@ -27,4 +27,16 @@ class InstanceService return Instance::whereAutoCw(true)->pluck('domain')->toArray(); }); } + + public static function software($domain) + { + $key = 'instances:software:' . strtolower($domain); + return Cache::remember($key, 86400, function() use($domain) { + $instance = Instance::whereDomain($domain)->first(); + if(!$instance) { + return; + } + return $instance->software; + }); + } }