public function makeUnique($id, $slug) {
        $repo = $this->getRepository();
        $scope = $this->getConfig('scope');

        /** @type \Titon\Db\Query $query */
        foreach ([
            $repo->select()->where($this->getConfig('slug'), $slug),
            $repo->select()->where($this->getConfig('slug'), 'like', $slug . '%')
        ] as $i => $query) {
            if ($scope) {
                $query->bindCallback($scope);
            }

            if ($id) {
                $query->where($repo->getPrimaryKey(), '!=', $id);
            }

            $count = $query->count();

            if ($count <= 0) {
                break;

            } else if ($i) {
                return $slug . '-' . $count;
            }
        }

        return $slug;
    }