File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ abstract class MenuItem implements MenuItemContract
3030
3131 protected bool $ isChecked = false ;
3232
33+ protected ?string $ event = null ;
34+
3335 public function enabled (): self
3436 {
3537 $ this ->isEnabled = true ;
@@ -107,12 +109,20 @@ public function submenu(MenuItemContract ...$items): self
107109 return $ this ;
108110 }
109111
112+ public function event (string $ event ): self
113+ {
114+ $ this ->event = $ event ;
115+
116+ return $ this ;
117+ }
118+
110119 public function toArray (): array
111120 {
112121 return array_filter ([
113122 'type ' => $ this ->type ,
114123 'id ' => $ this ->id ,
115124 'label ' => $ this ->label ,
125+ 'event ' => $ this ->event ,
116126 'sublabel ' => $ this ->sublabel ,
117127 'toolTip ' => $ this ->toolTip ,
118128 'enabled ' => $ this ->isEnabled ,
You can’t perform that action at this time.
0 commit comments