Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vickzkater committed Jul 2, 2020
1 parent c6117df commit f7a5203
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ How to call the function send SMS using GoSms library
$mobile = $request->input('mobile_phone');
$message = $request->input('message');
$trxid = uniqid();
$type = 0;
$debug = false;
$result = GoSms::send($mobile, $message, $trxid);
$result = GoSms::send($mobile, $message, $trxid, $type, $debug);
return $result; // Boolean
...
```

If you want to debug the function, set `$debug = true;` then the response of the function will be a string containing the response code and the response message from GoSMSGateway API (sample: "1702 - Invalid Username or Password")

For sample, please check `DevController.php`

## Contributing
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/DevController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public function send_sms(Request $request)
$mobile = $request->input('mobile_phone');
$message = $request->input('message');
$trxid = uniqid();
$type = 0;
$debug = false;

$result = GoSms::send($mobile, $message, $trxid);
$result = GoSms::send($mobile, $message, $trxid, $type, $debug);

return $result; // Boolean
}
Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/GoSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function send($mobile, $message, $trxid, $type = 0, $debug = false
}
if (!$username || !$password) {
if ($debug) {
return 'Auth credentials is not set';
return '0000 - Auth credentials is not set';
} else {
return false;
}
Expand Down

0 comments on commit f7a5203

Please sign in to comment.