File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1111
1212class Factory implements \Koffin \Menu \Contracts \Menu
1313{
14- public static string $ name ;
15- public static string $ group ;
16- public static ?MenuItemAttribute $ groupAttribute = null ;
17- public static ?Fluent $ factory = null ;
14+ private static string $ name ;
15+ private static string $ group ;
16+ private static ?MenuItemAttribute $ groupAttribute = null ;
17+ private static ?Fluent $ factory = null ;
1818 private static string $ childName ;
1919
2020 /**
@@ -151,6 +151,7 @@ public static function add(
151151 activeRoute: $ activeRoute ,
152152 activeRouteParam: $ activeRouteParam ,
153153 group: static ::$ group ,
154+ groupAttribute: static ::$ groupAttribute ,
154155 resolver: $ resolver ,
155156 )
156157 );
Original file line number Diff line number Diff line change @@ -18,13 +18,17 @@ public function __construct(
1818 public ?string $ activeRoute = null ,
1919 public ?array $ activeRouteParam = null ,
2020 public string $ group = 'Default ' ,
21+ public MenuItemAttribute |array $ groupAttribute = [],
2122 public \Closure |bool $ resolver = true ,
2223 public bool $ hasChild = false ,
2324 )
2425 {
2526 if (is_array ($ this ->attribute )) {
2627 $ this ->attribute = new MenuItemAttribute ($ this ->attribute );
2728 }
29+ if (is_array ($ this ->groupAttribute )) {
30+ $ this ->groupAttribute = new MenuItemAttribute ($ this ->groupAttribute );
31+ }
2832 }
2933
3034 public function resolve (): bool
You can’t perform that action at this time.
0 commit comments