pixelfed/app/Transformer/Api/MediaTransformer.php

24 lines
565 B
PHP
Raw Normal View History

2018-07-12 16:42:17 +00:00
<?php
namespace App\Transformer\Api;
use App\Media;
use League\Fractal;
class MediaTransformer extends Fractal\TransformerAbstract
{
public function transform(Media $media)
{
return [
2018-08-28 03:07:36 +00:00
'id' => $media->id,
2018-10-10 01:27:25 +00:00
'type' => $media->activityVerb(),
2018-08-28 03:07:36 +00:00
'url' => $media->url(),
'remote_url' => null,
2018-07-12 16:42:17 +00:00
'preview_url' => $media->thumbnailUrl(),
2018-08-28 03:07:36 +00:00
'text_url' => null,
2018-10-21 04:57:33 +00:00
'meta' => $media->metadata,
2018-08-28 03:07:36 +00:00
'description' => null,
2018-07-12 16:42:17 +00:00
];
}
2018-08-28 03:07:36 +00:00
}