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,
|
|
|
|
'type' => 'image',
|
|
|
|
'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
|
|
|
}
|