diff --git a/app/Transformer/ActivityPub/ProfileTransformer.php b/app/Transformer/ActivityPub/ProfileTransformer.php new file mode 100644 index 000000000..f3b1b84b9 --- /dev/null +++ b/app/Transformer/ActivityPub/ProfileTransformer.php @@ -0,0 +1,41 @@ + 'https://www.w3.org/ns/activitystreams', + 'id' => $profile->permalink(), + 'type' => 'Person', + 'following' => $profile->permalink('/following'), + 'followers' => $profile->permalink('/followers'), + 'inbox' => $profile->permalink('/inbox'), + 'outbox' => $profile->permalink('/outbox'), + 'featured' => $profile->permalink('/collections/featured'), + 'preferredUsername' => $profile->username, + 'name' => $profile->name, + 'summary' => $profile->bio, + 'url' => $profile->url(), + 'manuallyApprovesFollowers' => $profile->is_private, + 'follower_count' => $profile->followers()->count(), + 'following_count' => $profile->following()->count(), + 'publicKey' => [ + 'id' => $profile->permalink() . '#main-key', + 'owner' => $profile->permalink(), + 'publicKeyPem' => $profile->public_key + ], + 'endpoints' => [ + 'sharedInbox' => config('routes.api.sharedInbox') + ], + + ]; + } + +} \ No newline at end of file