diff --git a/app/Transformer/Api/StatusHashtagTransformer.php b/app/Transformer/Api/StatusHashtagTransformer.php new file mode 100644 index 000000000..a0874af7a --- /dev/null +++ b/app/Transformer/Api/StatusHashtagTransformer.php @@ -0,0 +1,35 @@ +hashtag; + $status = $statusHashtag->status; + $profile = $statusHashtag->profile; + + return [ + 'status' => [ + 'type' => $status->type, + 'url' => $status->url(), + 'thumb' => $status->thumb(), + 'sensitive' => (bool) $status->is_nsfw, + 'like_count' => $status->likes_count, + 'share_count' => $status->reblogs_count, + 'user' => [ + 'username' => $profile->username, + 'url' => $profile->url(), + ] + ], + 'hashtag' => [ + 'name' => $hashtag->name, + 'url' => $hashtag->url(), + ] + ]; + } +}