You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Transformer/ActivityPub/Verb/CreateStory.php

28 lines
680 B
PHP

<?php
namespace App\Transformer\ActivityPub\Verb;
use App\Story;
use League\Fractal;
class CreateStory extends Fractal\TransformerAbstract
{
public function transform(Story $story)
{
return [
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => $story->permalink(),
'type' => 'Add',
'actor' => $story->profile->permalink(),
'to' => [
$story->profile->permalink('/followers'),
],
'object' => [
'id' => $story->url(),
'type' => 'Story',
'object' => $story->bearcapUrl(),
],
];
}
}