Merge pull request #880 from pixelfed/frontend-ui-refactor

Update StatusTransformer
This commit is contained in:
daniel 2019-02-24 23:41:50 -07:00 committed by GitHub
commit 3627f90807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

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