Update StoryItemTransformer

This commit is contained in:
Daniel Supernault 2020-02-18 00:39:56 -07:00
parent c8abffb811
commit 876323228a
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -12,14 +12,15 @@ class StoryItemTransformer extends Fractal\TransformerAbstract
public function transform(StoryItem $item)
{
return [
'id' => (string) Str::uuid(),
'id' => (string) $item->id,
'type' => $item->type,
'length' => $item->duration,
'length' => $item->duration != 0 ? $item->duration : 3,
'src' => $item->url(),
'preview' => null,
'link' => null,
'linkText' => null,
'time' => $item->updated_at->format('U'),
'time' => $item->created_at->format('U'),
'expires_at' => $item->created_at->addHours(24)->format('U'),
'seen' => $item->story->seen(),
];
}