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 2
2
3
3
namespace Statikbe \FilamentFlexibleContentBlockPages \Models ;
4
4
5
+ use Illuminate \Database \Eloquent \Casts \Attribute ;
5
6
use Illuminate \Database \Eloquent \Factories \HasFactory ;
6
7
use Illuminate \Database \Eloquent \Model ;
7
8
use Illuminate \Database \Eloquent \Relations \BelongsTo ;
@@ -111,7 +112,14 @@ public function getMorphClass()
111
112
112
113
public static function getTreeLabelAttribute (): string
113
114
{
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
+ );
115
123
}
116
124
117
125
public function getTreeCaption (): string
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public static function getModel(): string|QueryBuilder
54
54
protected function getViewData (): array
55
55
{
56
56
$ query = static ::getModel ()::scoped (['menu_id ' => $ this ->record ->id ])
57
+ ->with ('linkable ' )
57
58
->defaultOrder ();
58
59
59
60
return [
You can’t perform that action at this time.
0 commit comments