Browse Source

Update InstanceService

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

+ 7 - 0
app/Services/InstanceService.php

@@ -7,6 +7,13 @@ use App\Instance;
 
 class InstanceService
 {
+	public static function getByDomain($domain)
+	{
+		return Cache::remember('pf:services:instance:by_domain:'.$domain, 3600, function() use($domain) {
+			return Instance::whereDomain($domain)->first();
+		});
+	}
+
 	public static function getBannedDomains()
 	{
 		return Cache::remember('instances:banned:domains', now()->addHours(12), function() {