1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/Transformer/ActivityPub/Verb/Announce.php

26 lines
698 B
PHP
Raw Normal View History

2018-11-13 06:15:08 +00:00
<?php
namespace App\Transformer\ActivityPub\Verb;
use App\Status;
use League\Fractal;
class Announce extends Fractal\TransformerAbstract
{
public function transform(Status $status)
{
return [
'@context' => 'https://www.w3.org/ns/activitystreams',
2019-06-24 20:36:41 +00:00
'id' => $status->permalink(),
2018-11-13 06:15:08 +00:00
'type' => 'Announce',
'actor' => $status->profile->permalink(),
2019-06-24 20:36:41 +00:00
'to' => ['https://www.w3.org/ns/activitystreams#Public'],
'cc' => [
$status->parent()->profile->permalink(),
$status->parent()->profile->follower_url
],
'published' => $status->created_at->format(DATE_ISO8601),
'object' => $status->parent()->url(),
2018-11-13 06:15:08 +00:00
];
}
}