diff --git a/app/Services/InstanceService.php b/app/Services/InstanceService.php new file mode 100644 index 000000000..8b504d77f --- /dev/null +++ b/app/Services/InstanceService.php @@ -0,0 +1,30 @@ +addHours(12), function() { + return Instance::whereBanned(true)->pluck('domain')->toArray(); + }); + } + + public static function getUnlistedDomains() + { + return Cache::remember('instances:unlisted:domains', now()->addHours(12), function() { + return Instance::whereUnlisted(true)->pluck('domain')->toArray(); + }); + } + + public static function getNsfwDomains() + { + return Cache::remember('instances:auto_cw:domains', now()->addHours(12), function() { + return Instance::whereAutoCw(true)->pluck('domain')->toArray(); + }); + } +}