uid = $uid; } public function transform(Topic $topic) { return [ 'id' => $topic['id'], 'name' => subtext($topic['name'], 5), 'img' => $topic['img'], 'follow_count' => getNumber($topic->follow->count() + $topic['base_count']), 'is_follow' => $topic->follow->where('uid', $this->uid)->count()?1:0, ]; } }