1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 01:05:36 +00:00

Update StatusTransformer

This commit is contained in:
Daniel Supernault 2019-02-24 23:41:12 -07:00
parent 19617f286c
commit eb7651e8ef
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -62,9 +62,10 @@ class StatusTransformer extends Fractal\TransformerAbstract
public function includeMediaAttachments(Status $status) public function includeMediaAttachments(Status $status)
{ {
return Cache::remember('status:transformer:media:attachments:'.$status->id, 1440, function() use($status) {
$media = $status->media()->orderBy('order')->get(); $media = $status->media()->orderBy('order')->get();
return $this->collection($media, new MediaTransformer()); return $this->collection($media, new MediaTransformer());
});
} }
public function includeTags(Status $status) public function includeTags(Status $status)