Skip to content

Commit 3826f14

Browse files
goodevilgeniuskainxspirits
authored andcommitted
Do not add attributes to push when none are passed (munir131#5)
Fixes munir131#4
1 parent bd0a428 commit 3826f14

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/PubSubQueue.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ public function pushRaw($payload, $queue = null, array $options = [])
8080

8181
$this->subscribeToTopic($topic);
8282

83-
return $topic->publish([
84-
'data' => $payload,
85-
'attributes' => $options,
86-
]);
83+
$publish = ['data' => $payload];
84+
85+
if (! empty($options)) {
86+
$publish['attributes'] = $options;
87+
}
88+
89+
return $topic->publish($publish);
8790
}
8891

8992
/**

0 commit comments

Comments
 (0)