PHP code example of iyngaran / sms-gateway
1. Go to this page and download the library: Download iyngaran/sms-gateway library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
iyngaran / sms-gateway example snippets
// config/sms_gateway.php
return [
'nexmo_sms_api_settings' => [
'API_KEY' => env('NEXMO_API_KEY', ''),
'API_SECRET' => env('NEXMO_API_SECRET', ''),
'SEND_SMS_FROM' => env('NEXMO_SMS_FROM', 'IYNGARAN'),
],
'twilio_sms_api_settings' => [
'SID' => env('TWILIO_SID', ''),
'TOKEN' => env('TWILIO_TOKEN', ''),
'SEND_SMS_FROM' => env('TWILIO_SMS_FROM', '+12012926824'),
],
'message_bird_sms_api_settings' => [
'API_KEY' => env('MESSAGE_BIRD_API_KEY', ''),
'SEND_SMS_FROM' => env('MESSAGE_BIRD_SMS_FROM', '+12012926824'),
],
'dialog_sms_api_settings' => [
'API_KEY' => env('DIALOG_SMS_API_KEY', ''),
'ENDPOINT' => env('DIALOG_SMS_ENDPOINT', ''),
'SEND_SMS_FROM' => env('DIALOG_SMS_FROM', 'IYNGARAN'),
],
];
'nexmo_sms_api_settings' => [
'API_KEY' => env('NEXMO_API_KEY', ''),
'API_SECRET' => env('NEXMO_API_SECRET', ''),
'SEND_SMS_FROM' => env('NEXMO_SMS_FROM', 'IYNGARAN'),
],
$objSMS = new SmsGateway(new NexmoSmsGateway());
$response = $objSMS->sendSms('+12012926822','Hello Nexmo');
twilio_sms_api_settings' => [
'SID' => env('TWILIO_SID', ''),
'TOKEN' => env('TWILIO_TOKEN', ''),
'SEND_SMS_FROM' => env('TWILIO_SMS_FROM', '+12012926824'),
]
$objSMST = new SmsGateway(new TwilioSmsGateway());
$response = $objSMST->sendSms('+12012926822','Hello Twilio');
'message_bird_sms_api_settings' => [
'API_KEY' => env('MESSAGE_BIRD_API_KEY', ''),
'SEND_SMS_FROM' => env('MESSAGE_BIRD_SMS_FROM', '+12012926824'),
]
$objSMST = new SmsGateway(new MessageBirdSmsGateway());
$response = $objSMST->sendSms('+12012926822','Hello MessageBird');
'dialog_sms_api_settings' => [
'API_KEY' => env('DIALOG_SMS_API_KEY', ''),
'ENDPOINT' => env('DIALOG_SMS_ENDPOINT', ''),
'SEND_SMS_FROM' => env('DIALOG_SMS_FROM', 'IYNGARAN'),
]
$objSMS = new SmsGateway(new DialogSmsGateway());
$response = $objSMS->sendSms('+12012926822','Hello, from Dialog SMS');