Follow.php 406 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Transformer\ActivityPub\Verb;
  3. use App\Follower;
  4. use League\Fractal;
  5. class Follow extends Fractal\TransformerAbstract
  6. {
  7. public function transform($follower)
  8. {
  9. return [
  10. '@context' => 'https://www.w3.org/ns/activitystreams',
  11. 'type' => 'Follow',
  12. 'actor' => $follower->actor->permalink(),
  13. 'object' => $follower->target->permalink()
  14. ];
  15. }
  16. }