public function deleteTracks(string $typeName, ?int $typeId = null, ?int $expiryTime = 0, int $trackableType = Tracker::TRACKER_LIVE) : int
    {
        $query = $this->getModel()
            ->newQuery()
            ->where('type', $this->getAlias($typeName));

        if ($typeId !== -1) {
            $query->where('type_id', $typeId);
        }

        if ($expiryTime !== null && $expiryTime > 0) {
            $query->whereRaw('(TIMESTAMPDIFF(MINUTE, created_at, NOW()) >= ?)', $expiryTime);
        }

        $query->where($this->typeClosure($trackableType));

        return $query->delete();
    }