public function preSave(Event $event, Query $query, $id, array &$data) {
        $config = $this->allConfig();

        if (empty($data) || empty($data[$config['field']]) || !empty($data[$config['slug']])) {
            return true;

        } else if ($query->getType() === Query::UPDATE && !$config['onUpdate']) {
            return true;
        }

        $slug = static::slugify($data[$config['field']]);

        // Leave a gap of 3 to account for the appended numbers
        if (mb_strlen($slug) > ($config['length'] - 3)) {
            $slug = mb_substr($slug, 0, ($config['length'] - 3));
        }

        if ($config['unique']) {
            $slug = $this->makeUnique($id, $slug);
        }

        $data[$config['slug']] = $slug;

        return true;
    }