1 | <?php |
||
2 | |||
3 | namespace App\Models; |
||
4 | |||
5 | use Illuminate\Database\Eloquent\Model; |
||
6 | use Spatie\Translatable\HasTranslations; |
||
7 | |||
8 | /** |
||
9 | * @mixin IdeHelperContactRelationship |
||
10 | */ |
||
11 | class ContactRelationship extends Model |
||
12 | { |
||
13 | use HasTranslations; |
||
14 | |||
15 | public $timestamps = false; |
||
16 | |||
17 | public array $translatable = ['name']; |
||
18 | |||
19 | protected $appends = ['translated_name']; |
||
20 | |||
21 | public function getTranslatedNameAttribute() |
||
22 | { |
||
23 | return $this->getTranslation('name', app()->getLocale()); |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
24 | } |
||
25 | } |
||
26 |