1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-30 11:44:59 +00:00
pixelfed/app/Transformer/ActivityPub/Verb/UndoLike.php

26 lines
597 B
PHP
Raw Normal View History

<?php
namespace App\Transformer\ActivityPub\Verb;
use App\Like as LikeModel;
use League\Fractal;
class UndoLike extends Fractal\TransformerAbstract
{
public function transform(LikeModel $like)
{
return [
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => $like->actor->permalink('#likes/'.$like->id.'/undo'),
'type' => 'Undo',
'actor' => $like->actor->permalink(),
'object' => [
'id' => $like->actor->permalink('#likes/'.$like->id),
'type' => 'Like',
'actor' => $like->actor->permalink(),
'object' => $like->status->url()
]
];
}
}