1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/Transformer/Api/MediaTransformer.php

24 lines
553 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,
'meta' => null,
'description' => null,
2018-07-12 16:42:17 +00:00
];
}
2018-08-28 03:07:36 +00:00
}