2022-06-03 07:29:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Transformer\ActivityPub\Verb;
|
|
|
|
|
|
|
|
use App\FollowRequest;
|
|
|
|
use League\Fractal;
|
|
|
|
|
|
|
|
class AcceptFollow extends Fractal\TransformerAbstract
|
|
|
|
{
|
|
|
|
public function transform(FollowRequest $follow)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
|
|
|
'type' => 'Accept',
|
|
|
|
'id' => $follow->permalink(),
|
|
|
|
'actor' => $follow->target->permalink(),
|
|
|
|
'object' => [
|
|
|
|
'type' => 'Follow',
|
2022-06-03 10:18:06 +00:00
|
|
|
'id' => $follow->activity && isset($follow->activity['id']) ? $follow->activity['id'] : null,
|
2022-06-03 07:29:50 +00:00
|
|
|
'actor' => $follow->actor->permalink(),
|
|
|
|
'object' => $follow->target->permalink()
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|