File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ class Notification
1414
1515 protected string $ event = '' ;
1616
17+ private bool $ hasReply = false ;
18+
19+ private string $ replyPlaceholder = '' ;
20+
21+ private array $ actions = [];
22+
1723 final public function __construct (protected Client $ client )
1824 {
1925 $ this ->title = config ('app.name ' );
@@ -45,6 +51,21 @@ public function event(string $event): self
4551 return $ this ;
4652 }
4753
54+ public function hasReply (string $ placeholder = '' ): self
55+ {
56+ $ this ->hasReply = true ;
57+ $ this ->replyPlaceholder = $ placeholder ;
58+
59+ return $ this ;
60+ }
61+
62+ public function addAction (string $ label ): self
63+ {
64+ $ this ->actions [] = $ label ;
65+
66+ return $ this ;
67+ }
68+
4869 public function message (string $ body ): self
4970 {
5071 $ this ->body = $ body ;
@@ -59,6 +80,9 @@ public function show(): self
5980 'title ' => $ this ->title ,
6081 'body ' => $ this ->body ,
6182 'event ' => $ this ->event ,
83+ 'hasReply ' => $ this ->hasReply ,
84+ 'replyPlaceholder ' => $ this ->replyPlaceholder ,
85+ 'actions ' => $ this ->actions ,
6286 ]);
6387
6488 $ this ->reference = $ response ->json ('reference ' );
You can’t perform that action at this time.
0 commit comments