From e7c08fbbb2ed55acc04d2bd47a510c618319490e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 18 Dec 2023 22:32:48 -0700 Subject: [PATCH] Update AccountService, add blocksDomain method --- app/Services/AccountService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Services/AccountService.php b/app/Services/AccountService.php index fa1613ca..98e87884 100644 --- a/app/Services/AccountService.php +++ b/app/Services/AccountService.php @@ -7,6 +7,7 @@ use App\Profile; use App\Status; use App\User; use App\UserSetting; +use App\Models\UserDomainBlock; use App\Transformer\Api\AccountTransformer; use League\Fractal; use League\Fractal\Serializer\ArraySerializer; @@ -234,4 +235,13 @@ class AccountService } return; } + + public static function blocksDomain($pid, $domain = false) + { + if(!$domain) { + return; + } + + return UserDomainBlock::whereProfileId($pid)->whereDomain($domain)->exists(); + } }