whereFollowingId($target)->exists(); } public static function audience($profile) { return (new self)->getAudienceInboxes($profile); } protected function getAudienceInboxes($profile) { if($profile instanceOf User) { return $profile ->profile ->followers() ->whereLocalProfile(false) ->get() ->map(function($follow) { return $follow->sharedInbox ?? $follow->inbox_url; }) ->unique() ->values() ->toArray(); } if($profile instanceOf Profile) { return $profile ->followers() ->whereLocalProfile(false) ->get() ->map(function($follow) { return $follow->sharedInbox ?? $follow->inbox_url; }) ->unique() ->values() ->toArray(); } if(is_string($profile) || is_integer($profile)) { $profile = Profile::whereNull('domain')->find($profile); if(!$profile) { return []; } return $profile ->followers() ->whereLocalProfile(false) ->get() ->map(function($follow) { return $follow->sharedInbox ?? $follow->inbox_url; }) ->unique() ->values() ->toArray(); } return []; } }