2017 © Pedro Peláez
 

package sms

A package to send SMS using mobily.ws, smsgw.net API

image

abdullahobaid/sms

A package to send SMS using mobily.ws, smsgw.net API

  • Wednesday, May 2, 2018
  • by AbdullahObaid
  • Repository
  • 1 Watchers
  • 2 Stars
  • 60 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 22 % Grown

The README.md

Description

A Laraval Package to send sms messages. It supports multiple sms gateways, and easily extendable to support new gateways. The default cofing supports mobily.ws and smsgw.net , and you can easily add any other gateway ( see Defining new gateways ), (*1)

Table of Contents

Features & Requirements

  • Supports sending messages directly
  • Supports sending messages at a certain date/time
  • Supports sending messages to multiple numbers at once
  • Supports multiple number formats see Usage
  • Support using multiple gateways and sender names at the same time.
  • Requires an active account with any sms gateway.
  • Supports Laravel 5.*
  • cURL
  • php >=5.5.0

Installation

Install with composer by running composer require abdullahobaid/sms:dev-master
Composer will download and install the package. if you are using Laravel > 5.5 go directly to Config if you are using laravel < 5.4 ONLY open config/app.php and add the service provider and alias as below:, (*2)

'providers' => array(
    ...
    abdullahobaid\sms\SmsProvider::class,
),
.
.
.
'aliases' => array(
    ...
    'SMS'    => abdullahobaid\sms\SMS::class,
),

config

Publish the configuration file by running the following Artisan command., (*3)

$ php artisan vendor:publish --provider="abdullahobaid\sms\SmsProvider"

Finally, you need to edit the configuration file at config/sms.php with your own gateway info. Also you need to set your default Gateway at the top of the config file., (*4)

Usage

Methods

Check Balance

SMS::Balance($gatewayName = false);

Returns the current balance for the default gateway or for the giving one., (*5)

Send Message / Messages

SMS::Send($numbers,$message,$dateTime=false,$senderName=false,$gatwayName=false);

$numbers ( Required )

You can pass a single number or array of numbers, see examples below:, (*6)

  • The number can be sent with trailing zeros 00966555555555
  • With trailing plus sign +966555555555
  • International number without trailing zeros 966555555555
  • Even you can use the mobile number without international code - for Saudi Mobile Numbers Only - 0555555555 , the package will take care of formatting the number.

$message ( Required )

The message text, (*7)

$dateTime ( Optional )

dateTime format Y-m-d H:i:s, (*8)

$senderName ( Optional )

Override default sender name, (*9)

$gatewayName ( Optional )

Override default gateway, (*10)

Examples

Send SMS message directly

Will send the message directly to the number, (*11)

SMS::Send(966555555555, 'Your Message Here');

Returns true if the message is sent, false if not., (*12)

Send SMS to Multiple Numbers

Pass an array of numbers instead of a single number to send to all of them, (*13)

$numbers = array('966555555555','966545555555','966565555555');
SMS::Send($numbers, 'Your Message Here');

Returns true if the message is sent, false if not., (*14)

Send SMS message at a certain date/time

Will send the message in a desired date and time, (*15)

SMS::send(966555555555, 'Your Message Here', $dateTime);
note
  • DateTime format Y-m-d H:i:s
  • Returns true if the message is sent, false if not.

Check the current Balance

SMS::Balance();

Returns user's balance., (*16)

Get number of SMS messages a text requires

SMS::count_messages($text);

Override default sender name

SMS::Send(966555555555, 'Your Message Here', $dateTime=false,'SenderName');

Note that the new sender should be registered and activate at mobily.ws website, (*17)

License

Waqf General Public Licens, (*18)

Essentials

The Versions

02/05 2018

dev-master

9999999-dev

A package to send SMS using mobily.ws, smsgw.net API

  Sources   Download

MIT waqf

The Requires

  • php >=5.3.0

 

laravel mobily.ws smsgw.net