public function setTranslation(string $key, string $value = null, string $locale = null)
    {
        $this->throwExceptionIfAttributeIsNotTranslatable($key);

        $locale = $locale ?: config('app.locale');

        $translations = $this->getTranslations($key);

        if ($this->hasSetMutator($key)) {
            $value = $this->{'set'.Str::studly($key).'Attribute'}($value);
        }

        $translations[$locale] = $value;

        $this->attributes[$key] = json_encode($translations);

        return $this;
    }