File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Support \Traits \Tappable ;
6
6
use Statamic \Contracts \Structures \Structure as StructureContract ;
7
+ use Statamic \Contracts \Data \Augmentable ;
8
+ use Statamic \Data \HasAugmentedData ;
7
9
use Statamic \Facades ;
8
10
use Statamic \Support \Str ;
9
11
use Statamic \Support \Traits \FluentlyGetsAndSets ;
10
12
11
- abstract class Structure implements StructureContract
13
+ abstract class Structure implements StructureContract, Augmentable
12
14
{
13
15
use FluentlyGetsAndSets, Tappable;
14
16
@@ -19,6 +21,8 @@ abstract class Structure implements StructureContract
19
21
protected $ maxDepth ;
20
22
protected $ expectsRoot = false ;
21
23
24
+ use HasAugmentedData;
25
+
22
26
public function id ()
23
27
{
24
28
return $ this ->handle ();
@@ -115,4 +119,12 @@ public static function __callStatic($method, $parameters)
115
119
{
116
120
return Facades \Structure::{$ method }(...$ parameters );
117
121
}
122
+
123
+ public function augmentedArrayData ()
124
+ {
125
+ return [
126
+ 'title ' => $ this ->title (),
127
+ 'handle ' => $ this ->handle ()
128
+ ];
129
+ }
118
130
}
You can’t perform that action at this time.
0 commit comments