Add AP Announce Transformer

This commit is contained in:
Daniel Supernault 2018-11-12 23:15:08 -07:00
parent e2e5918213
commit 23f4a1cfec
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -0,0 +1,19 @@
<?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',
'type' => 'Announce',
'actor' => $status->profile->permalink(),
'object' => $status->parent()->url()
];
}
}