|
|
|
@ -2,12 +2,15 @@
|
|
|
|
|
|
|
|
|
|
namespace App\Transformer\Api;
|
|
|
|
|
|
|
|
|
|
use App\Like;
|
|
|
|
|
use App\Status;
|
|
|
|
|
use League\Fractal;
|
|
|
|
|
use Cache;
|
|
|
|
|
use App\Services\HashidService;
|
|
|
|
|
use App\Services\LikeService;
|
|
|
|
|
use App\Services\MediaTagService;
|
|
|
|
|
use App\Services\StatusLabelService;
|
|
|
|
|
use App\Services\ProfileService;
|
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
|
|
class StatusTransformer extends Fractal\TransformerAbstract
|
|
|
|
@ -34,8 +37,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|
|
|
|
'content_text' => $status->caption,
|
|
|
|
|
'created_at' => $status->created_at->format('c'),
|
|
|
|
|
'emojis' => [],
|
|
|
|
|
'reblogs_count' => $status->reblogs_count ?? 0,
|
|
|
|
|
'favourites_count' => $status->likes_count ?? 0,
|
|
|
|
|
'reblogs_count' => 0,
|
|
|
|
|
'favourites_count' => 0,
|
|
|
|
|
'reblogged' => $status->shared(),
|
|
|
|
|
'favourited' => $status->liked(),
|
|
|
|
|
'muted' => null,
|
|
|
|
@ -59,7 +62,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|
|
|
|
'place' => $status->place,
|
|
|
|
|
'local' => (bool) $status->local,
|
|
|
|
|
'taggedPeople' => $taggedPeople,
|
|
|
|
|
'label' => StatusLabelService::get($status)
|
|
|
|
|
'label' => StatusLabelService::get($status),
|
|
|
|
|
'liked_by' => LikeService::likedBy($status)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|