Skip to content

Commit 0a64973

Browse files
committed
missing group attribute
1 parent b14e93f commit 0a64973

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Factory.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
class 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
);

src/MenuItem.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)