public function setTitleAttribute($value) {
        $this->attributes['title'] = $value;

        if (!$this->slug) {
            $slug = str_transliterate($value);
            $slugCount = self::whereRaw('slug REGEXP "^' . $slug . '(-[0-9]*)?$"')->count();
            if ($slugCount > 0)
                $slug = $slug . '-' . $slugCount;

            $this->attributes['slug'] = $slug;
        }
    }