1
0
Fork 0
pixelfed/app/Transformer/ActivityPub/Verb/Like.php

20 lines
434 B
PHP
Raw Normal View History

2018-11-13 05:26:19 +00:00
<?php
namespace App\Transformer\ActivityPub\Verb;
use App\Like as LikeModel;
use League\Fractal;
class Like extends Fractal\TransformerAbstract
{
2018-12-21 19:56:56 +00:00
public function transform(LikeModel $like)
{
return [
'@context' => 'https://www.w3.org/ns/activitystreams',
2019-06-24 20:26:16 +00:00
'id' => $like->actor->permalink('#likes/'.$like->id),
2018-12-21 19:56:56 +00:00
'type' => 'Like',
'actor' => $like->actor->permalink(),
'object' => $like->status->url()
];
}
2018-11-13 05:26:19 +00:00
}