whereFollowingId($target)->exists(); } public static function audience($profile, $scope = null) { return (new self)->getAudienceInboxes($profile); } protected function getAudienceInboxes($profile, $scope = null) { if(!$profile instanceOf Profile) { return []; } $key = 'pf:services:follow:audience:' . $profile->id; return Cache::remember($key, 86400, function() use($profile) { return $profile ->followers() ->whereLocalProfile(false) ->get() ->map(function($follow) { return $follow->sharedInbox ?? $follow->inbox_url; }) ->unique() ->values() ->toArray(); }); } }