Skip to content

Commit 0ba89b8

Browse files
committed
Fix linkable morph to relationship in menu item
1 parent bda5e01 commit 0ba89b8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Models/MenuItem.php

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

43+
public $translatable = ['label'];
44+
4345
public function getTable()
4446
{
4547
return FilamentFlexibleContentBlockPages::config()->getMenuItemsTable();
@@ -52,7 +54,7 @@ public function menu(): BelongsTo
5254

5355
public function linkable(): MorphTo
5456
{
55-
return $this->morphTo();
57+
return $this->morphTo(__FUNCTION__, 'linkable_type', 'linkable_id');
5658
}
5759

5860
public function getUrl(?string $locale = null): ?string
@@ -104,9 +106,4 @@ public function getMorphClass()
104106
{
105107
return 'filament-flexible-content-block-pages::menu-item';
106108
}
107-
108-
protected function getTranslatableAttributes(): array
109-
{
110-
return ['label'];
111-
}
112109
}

0 commit comments

Comments
 (0)