CreateStory.php 578 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Transformer\ActivityPub\Verb;
  3. use Storage;
  4. use App\Story;
  5. use League\Fractal;
  6. use Illuminate\Support\Str;
  7. class CreateStory extends Fractal\TransformerAbstract
  8. {
  9. public function transform(Story $story)
  10. {
  11. return [
  12. '@context' => 'https://www.w3.org/ns/activitystreams',
  13. 'id' => $story->permalink(),
  14. 'type' => 'Add',
  15. 'actor' => $story->profile->permalink(),
  16. 'to' => [
  17. $story->profile->permalink('/followers')
  18. ],
  19. 'object' => [
  20. 'id' => $story->url(),
  21. 'type' => 'Story',
  22. 'object' => $story->bearcapUrl(),
  23. ]
  24. ];
  25. }
  26. }