mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 16:30:45 +00:00
Add AP Follow Transformer
This commit is contained in:
parent
39b4dbf354
commit
e2e5918213
1 changed files with 19 additions and 0 deletions
19
app/Transformer/ActivityPub/Verb/Follow.php
Normal file
19
app/Transformer/ActivityPub/Verb/Follow.php
Normal 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()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue