private function slug($value = null) {
        // generate slug
        $slug = strtolower(Text::slug($value, $this->_config['replacement']));

        // unique slug?
        if($this->_config['unique']) {
            // does the slug already exist?
            $field = $this->_table->getAlias() . '.slug';
            $conditions = [$field => $slug];
            $suffix = '';
            $i = 0;

            // loop till unique slug is found
            while ($this->_table->exists($conditions)) {
                $i++;
                $suffix = $this->_config['replacement'] . $i;
                $conditions[$field] = $slug . $suffix;
            }

            // got suffix? append it
            if($suffix)
                $slug .= $suffix;
        }

        // return slug
        return $slug;
    }