1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 16:53:17 +00:00

Add AP Follow Transformer

This commit is contained in:
Daniel Supernault 2018-11-12 22:29:27 -07:00
parent 39b4dbf354
commit e2e5918213
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -0,0 +1,19 @@
<?php
namespace App\Transformer\ActivityPub\Verb;
use App\Follower;
use League\Fractal;
class Follow extends Fractal\TransformerAbstract
{
public function transform(Follower $follower)
{
return [
'@context' => 'https://www.w3.org/ns/activitystreams',
'type' => 'Follow',
'actor' => $follower->actor->permalink(),
'object' => $follower->target->permalink()
];
}
}