File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 66
77class Notification
88{
9+ protected ?string $ reference = null ;
10+
911 protected string $ title ;
1012
1113 protected string $ body ;
@@ -22,6 +24,13 @@ public static function new()
2224 return new static (new Client );
2325 }
2426
27+ public function reference (string $ reference ): self
28+ {
29+ $ this ->reference = $ reference ;
30+
31+ return $ this ;
32+ }
33+
2534 public function title (string $ title ): self
2635 {
2736 $ this ->title = $ title ;
@@ -43,12 +52,17 @@ public function message(string $body): self
4352 return $ this ;
4453 }
4554
46- public function show (): void
55+ public function show (): self
4756 {
48- $ this ->client ->post ('notification ' , [
57+ $ response = $ this ->client ->post ('notification ' , [
58+ 'reference ' => $ this ->reference ,
4959 'title ' => $ this ->title ,
5060 'body ' => $ this ->body ,
5161 'event ' => $ this ->event ,
5262 ]);
63+
64+ $ this ->reference = $ response ->json ('reference ' );
65+
66+ return $ this ;
5367 }
5468}
You can’t perform that action at this time.
0 commit comments