Skip to content

Commit 86349c9

Browse files
committed
Fix translatable label bug
1 parent 72b86ad commit 86349c9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Models/MenuItem.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class MenuItem extends Model
4040
'use_model_title' => 'boolean',
4141
];
4242

43-
public $translatable = ['label'];
43+
public function getTranslatableAttributes(): array
44+
{
45+
return array_merge($this->translatable, ['slug']);
46+
}
4447

4548
public function getTable()
4649
{
@@ -54,7 +57,7 @@ public function menu(): BelongsTo
5457

5558
public function linkable(): MorphTo
5659
{
57-
return $this->morphTo(__FUNCTION__, 'linkable_type', 'linkable_id');
60+
return $this->morphTo('linkable', 'linkable_type', 'linkable_id');
5861
}
5962

6063
public function getUrl(?string $locale = null): ?string

0 commit comments

Comments
 (0)