spatie / laravel-translatable

Making Eloquent models translatable

Home Page:https://spatie.be/docs/laravel-translatable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom attributes returning empty string

Muhammadinaam opened this issue · comments

Laravel: 8
spatie/laravel-translatable: 4.6.0

I have added text attribute to my model (see following code):

public function getTextAttribute()
{
    return 'Name: ' . $this->name;
}

When I added use HasTranslations to my model, $model->text return "" empty string. Otherwise (without useHasTranslations), $model->text works fine.

Sorry, I was doing some mistakes.