File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace Statikbe \FilamentFlexibleContentBlockPages \Models ;
44
5+ use Illuminate \Database \Eloquent \Casts \Attribute ;
56use Illuminate \Database \Eloquent \Factories \HasFactory ;
67use Illuminate \Database \Eloquent \Model ;
78use Illuminate \Database \Eloquent \Relations \BelongsTo ;
@@ -111,7 +112,14 @@ public function getMorphClass()
111112
112113 public static function getTreeLabelAttribute (): string
113114 {
114- return 'label ' ;
115+ return 'tree_label ' ;
116+ }
117+
118+ protected function treeLabel (): Attribute
119+ {
120+ return Attribute::make (
121+ get: fn (string $ value ) => $ this ->getDisplayLabel (),
122+ );
115123 }
116124
117125 public function getTreeCaption (): string
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public static function getModel(): string|QueryBuilder
5454 protected function getViewData (): array
5555 {
5656 $ query = static ::getModel ()::scoped (['menu_id ' => $ this ->record ->id ])
57+ ->with ('linkable ' )
5758 ->defaultOrder ();
5859
5960 return [
You can’t perform that action at this time.
0 commit comments