From 66f04bec25ca523b8af2eaf68125cccc2e2c91d7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 19 Oct 2021 19:51:14 -0600 Subject: [PATCH] Update InstanceService --- app/Services/InstanceService.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Services/InstanceService.php b/app/Services/InstanceService.php index 48117d159..c95b6ac25 100644 --- a/app/Services/InstanceService.php +++ b/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() {