Move.php 708 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Transformer\ActivityPub\Verb;
  3. use App\Models\ProfileMigration;
  4. use League\Fractal;
  5. class Move extends Fractal\TransformerAbstract
  6. {
  7. public function transform(ProfileMigration $migration)
  8. {
  9. $objUrl = $migration->target->permalink();
  10. $id = $migration->target->permalink('#moves/'.$migration->id);
  11. $to = $migration->target->permalink('/followers');
  12. return [
  13. '@context' => 'https://www.w3.org/ns/activitystreams',
  14. 'id' => $id,
  15. 'actor' => $objUrl,
  16. 'type' => 'Move',
  17. 'object' => $objUrl,
  18. 'target' => $migration->profile->permalink(),
  19. 'to' => $to,
  20. ];
  21. }
  22. }