LaravelPackages.net
Acme Inc.
Toggle sidebar
pnlinh/laravel-infobip-sms

Infobip Sms Service in Laravel

73.322
9
v1.0.4
About pnlinh/laravel-infobip-sms

pnlinh/laravel-infobip-sms is a Laravel package for infobip sms service in laravel. It currently has 9 GitHub stars and 73.322 downloads on Packagist (latest version v1.0.4). Install it with composer require pnlinh/laravel-infobip-sms. Discover more Laravel packages by pnlinh or browse all Laravel packages to compare alternatives.

Last updated

Send Sms use Infobip in Laravel

StyleCI Quality Score

Requirements

  • PHP >= 7.1
  • Laravel >= 5.5.*

Installation

Require this package with composer.

composer require pnlinh/laravel-infobip-sms

To publishes config config/infobip-sms.php, use command:

php artisan vendor:publish --tag="infobip-sms"

You set config in .env or config/infobip-sms.php

return [
    'from' => env('INFOBIP_FROM', 'Laravel'),
    'username' => env('INFOBIP_USERNAME', 'user'),
    'password' => env('INFOBIP_PASSWORD', '123456'),
];

Usage

// Send to one number
use Pnlinh\InfobipSms\Facades\InfobipSms;

$response = InfobipSms::send('84123456789', 'Hello Infobip');

// Send to multiple number
$response = InfobipSms::send(['84123456789', '84987654321'], 'Hello Infobip');

// Use Helper Function
$response = infobip_sms_send('84123456789', 'Hello Infobip');

// Get response
array:2 [
0 => 200
1 => {#362
 +"messages": array:1 [
   0 => {#355
     +"to": "84123456789"
     +"status": {#356
       +"groupId": 1
       +"groupName": "PENDING"
       +"id": 8
       +"name": "PENDING_ENROUTE"
       +"description": "Message sent to next instance"
     }
     +"smsCount": 1
     +"messageId": "2411455387981631234"
   }
 ]
}
]

$responseCode = $response[0];
$responseBody = $response[1];

Credits

For more info, please visit https://dev.infobip.com/send-sms/single-sms-message

Comments