Browse Source

Update InstanceService

Daniel Supernault 3 năm trước cách đây
mục cha
commit
2fb916c22b
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      app/Services/InstanceService.php

+ 12 - 0
app/Services/InstanceService.php

@@ -27,4 +27,16 @@ class InstanceService
 			return Instance::whereAutoCw(true)->pluck('domain')->toArray();
 			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;
+		});
+	}
 }
 }