Update InstanceService

This commit is contained in:
Daniel Supernault 2021-08-31 00:37:28 -06:00
parent ad2db4aea7
commit 2fb916c22b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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;
});
}
}