Skip to content

Commit 84e9e66

Browse files
committed
Implemented HTML Key for Stream Request
1 parent 5d48a49 commit 84e9e66

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/Requests/CreateAChildToAnArtifact.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function defaultQuery(): array
5151

5252
public function defaultBody(): array
5353
{
54+
5455
$body = [
5556
'name' => $this->name,
5657
'type' => $this->type,

src/Requests/CreateAPostInAGivenStream.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class CreateAPostInAGivenStream extends Request implements HasBody
2020

2121
public function __construct(
2222
protected readonly string $streamId,
23-
protected readonly string $text,
23+
protected readonly ?string $text = null,
24+
protected readonly ?string $html = null,
2425
protected readonly ?string $title = null,
2526
protected null|array|Collection $labels = null,
2627
protected readonly bool $sticky = false,
@@ -55,14 +56,18 @@ public function defaultBody(): array
5556
{
5657
$body = [];
5758

58-
if (filled($this->title)) {
59-
$body = Arr::add(array: $body, key: 'title', value: $this->title);
60-
}
61-
6259
if (filled($this->text)) {
6360
$body = Arr::add(array: $body, key: 'text', value: $this->text);
6461
}
6562

63+
if (filled($this->html)) {
64+
$body = Arr::add(array: $body, key: 'html', value: $this->html);
65+
}
66+
67+
if (filled($this->title)) {
68+
$body = Arr::add(array: $body, key: 'title', value: $this->title);
69+
}
70+
6671
$labels = $this->labels;
6772

6873
if ($labels instanceof Collection) {

0 commit comments

Comments
 (0)