8000 Fixed String Mobile bug · gr8shivam/laravel-sms-api@4f0aabb · GitHub
[go: up one dir, main page]

Skip to content
Dismiss alert

Commit 4f0aabb

Browse files
committed
Fixed String Mobile bug
1 parent ad2e7ef commit 4f0aabb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/SmsApi.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,18 @@ public function sendMessage($to, $message, $extra_params = null, $extra_headers
8484
$url = $this->config['url'];
8585

8686
$mobile = $this->config['add_code'] ? $this->addCountryCode($to) : $to;
87-
if (is_array($mobile)) {
88-
//Flatten Array only if JSON false
89-
if (!(isset($this->config['json']) && $this->config['json'])) {
87+
if (!(isset($this->config['json']) && $this->config['json'])) {
88+
//Flatten Array if JSON false
89+
if (is_array($mobile)){
9090
$mobile = $this->composeBulkMobile($mobile);
9191
}
9292
}
93+
else{
94+
//Transform to Array if JSON true
95+
if (!is_array($mobile)){
96+
$mobile = array($mobile);
97+
}
98+
}
9399

94100
$params = $this->config['params']['others'];
95101

0 commit comments

Comments
 (0)
0