Add AP Like Transformer
This commit is contained in:
parent
61d35ce3f6
commit
39b4dbf354
1 changed files with 19 additions and 0 deletions
19
app/Transformer/ActivityPub/Verb/Like.php
Normal file
19
app/Transformer/ActivityPub/Verb/Like.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Transformer\ActivityPub\Verb;
|
||||||
|
|
||||||
|
use App\Like as LikeModel;
|
||||||
|
use League\Fractal;
|
||||||
|
|
||||||
|
class Like extends Fractal\TransformerAbstract
|
||||||
|
{
|
||||||
|
public function transform(LikeModel $like)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||||
|
'type' => 'Like',
|
||||||
|
'actor' => $like->actor->permalink(),
|
||||||
|
'object' => $like->status->url()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue