One Way SMS Gateway API - Laravel Library Worked on API Version 1.2
- Send SMS (Short Message Service)
Set One Way SMS Gateway auth credentials in .env
file
...
ONEWAYSMS_API=xxx
ONEWAYSMS_AUTH_USER=xxx
ONEWAYSMS_AUTH_PASS=xxx
...
Copy OnewaySms.php
to your Laravel project - for sample copy then paste in app/Libraries
In your Controller file, please include the OnewaySms library
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
// USE LIBRARIES
use App\Libraries\OnewaySms;
class XxxController extends Controller
{
....
How to call the function send SMS using OnewaySms library
...
// SET THE PARAMETERS
$mobile = $request->input('mobile_phone');
$message = $request->input('message');
$debug = false;
$result = OnewaySms::send($mobile, $message, $debug);
return $result; // Boolean
...
If you want to debug the function, set $debug = true;
then the response of the function will be an array containing the response status, the response code, and the response message from OnewaySms Gateway API
// result sample:
array:3 [▼
"status" => false
"code" => -100
"message" => "apipassname or apipassword is invalid"
]
For sample, please check DevController.php
Thank you for considering contributing to the OnewaySms.
If you discover a bug or security vulnerability within OnewaySms, please send an email to Vicky Budiman at vicky@kiniditech.com. All requests will be addressed promptly.
If you come across any issue/bug please report them here.
OnewaySms is open-sourced software built by KINIDI Tech and contributors and licensed under the MIT license.
- Vicky Budiman (https://github.com/vickzkater)
- One Way SMS (https://www.onewaysms.com.my/)
Brought to you by
KINIDI Tech