PHPackages                             secrethash/smsg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. secrethash/smsg

ActiveProject[HTTP &amp; Networking](/categories/http)

secrethash/smsg
===============

SMSG is a SMS Sending package made for sending SMS used for Verification, Newsletter, Invoicing, Purchase Confirmation, etc.

v1.1.4(8y ago)353.3k↑154%9[1 issues](https://github.com/secrethash/smsg/issues)MITPHP

Since Jul 6Pushed 8y ago5 watchersCompare

[ Source](https://github.com/secrethash/smsg)[ Packagist](https://packagist.org/packages/secrethash/smsg)[ RSS](/packages/secrethash-smsg/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

---

SMSG - SMS Package
==================

[](#smsg---sms-package)

[![GitHub license](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/secrethash/smsg/master/LICENSE) [![Packagist](https://camo.githubusercontent.com/93e0cf9ccb62b4c8abdff4ce0ac027f52a0a60f009fa94cb9c1ebfd9a465eedd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736563726574686173682f736d73672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/secrethash/smsg) [![Packagist](https://camo.githubusercontent.com/c84646a64c263fee48d0de84e6617d070c5e38e1a8d93c6a44e74591fbcd58cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736563726574686173682f736d73672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/secrethash/smsg) [![GitHub release](https://camo.githubusercontent.com/cb8fae87bdfafe88cda952d78bfd4ab8f6e2ac0941c3f6e233a555010107149d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f736563726574686173682f736d73672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/secrethash/smsg)

***Socialize:***

[![Twitter Follow](https://camo.githubusercontent.com/e8d21e44f27c783d241542aa12bc068f6dd9a005bb45f41c7bdbffe89fffe697/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f736563726574686173682e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77267374796c653d666c61742d737175617265)](https://twitter.com/secrethash) [![Twitter](https://camo.githubusercontent.com/f83a67e498f66a0e7f1d2021606e5bbee2a86ba67a728a3cfdccf8167f260898/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f736563726574686173682f64726f706d656e752e7376673f7374796c653d736f6369616c267374796c653d666c61742d737175617265)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D)

---

Introduction
------------

[](#introduction)

> ***Don't go on the name. :P***. The name is just a mixture of SMS and MSG (seriously! :D ).

SMSG is a Messaging Package or SMS Package that was created for the ease of sending messages using the APIs of Popular Service Providers. SMSG was made keeping in mind the possibilities of SMS Technology.

In today's world the SMS have been depreciated from normal people's life, but we Programmers and Coders have many possibilities with SMS Technology, still. SMS is very Important in our lives. See how below:

- **SMS Verification:** SMS can be used as a method of verification of users over bots and also for valid phone numbers.
- **Transaction Summary:** Transaction Summary can be sent to the users to tell them about their most recent purchase.
- **Purchase Confirmation:** Purchase Confirmation Request codes can be sent to user's mobile devices and requested on website. This can be used as 2-step Purchase Verification for users buying via their wallet credits.
- \*\*Many More: \*\* Possibilities are only limited by your thinking, therefore, expand and more possibilities will take birth.

Install
-------

[](#install)

Just a one line `composer` command:

`composer require secrethash/smsg`

> That's It!

Setup
-----

[](#setup)

Setting up **SMSG** is also not difficult. Just follow the below steps for successfully setting up the package.

---

### Step 1: Service Provider

[](#step-1-service-provider)

You will have to add the `SmsgServiceProvider` in the Provider's array:

- Open `config\app.php` file.
- Find `'providers'` array.
- At the end of the array add `Secrethash\Smsg\SmsgServiceProvider::class,`

### Step 2: Facade

[](#step-2-facade)

The working should always be easy, right? Facade makes it happen. After you register the SMSG's Facade, you will be able to access it via `SMSG` facade directly. For example:

```
SMSG::showbal('msg91'); // outputs balance for MSG91.com
```

***Let's set it up:***

- Open `config\app.php`
- Find `'aliases'`array
- At the end add `'SMSG'      => Secrethash\Smsg\Facade\Smsg::class,`

> Hurrah!

### Step 3: Configuration

[](#step-3-configuration)

You will have to publish the SMSG's Config File to get started with it. Run the Command:

`php artisan vendor:publish --provider=Secrethash\Smsg\SmsgServiceProvider`

Now open the SMSG configuration file which must be at `config\smsg.php` and edit according to your Provider and needs.

> Done! You are now ready to Rock 'n Roll!

---

Working with SMSG
-----------------

[](#working-with-smsg)

Working is very easy with SMSG. There are certain functions that are needed to be triggered to get the desired work done. All the available functions are listed below:

---

### Sending Message

[](#sending-message)

To send a message using SMSG you just need to trigger the`SMSG::send()` function with the required parameters.

#### Parameters:

[](#parameters)

1. **Mobile Number(s):** It is the first parameter to be passed. There can be single mobile number or multiple mobile numbers. ***Multiple Mobile Numbers*** should be separated by commas for eg: `0123456789, 9876543210`.
    - ***FIELD REQUIRED***
    - ***MUST BE NUMBERS ONLY***

> **NOTE:** Do Not provide multiple mobile numbers in an array. Separate it by commas only.

1. **Sender ID:** The sender ID is the ID that is shown on the receiver's mobile in place of a sender's mobile number. For Eg: `DM-SMSG`. Sender ID should be in supplied in ***Plain Text Only***.

    - ***FIELD REQUIRED***
    - ***PLAIN TEXT ONLY***
2. **Message:** Message is basically the body of SMS that you want to send.

    - ***FIELD REQUIRED***
3. **Provider:** Provider is not important to be filled. If you want to use a different provider for a particular SMS then you should provide it's valid ID as the Input for **4th Parameter**, otherwise the default provider will be used as defined in your `config\smsg.php` file.

    - ***NOT COMPULSORY***
    - ***SHOULD BE A VALID PROVIDER ID***

> **NOTE:** Find the Available Provider's ID below.

1. **Route:** Route is the passage of sending a message. Mostly, there are only 2 Routes: 2. *Transaction:* It is a Passage for SMS that has higher delivery rate than others. This passage is for Transaction Related Messages, to send the user transaction summary or some other important message like Mobile Number Verification code. Many Provider prohibit Promotion Messages through Transaction Route. Sometimes account can also get suspended. 3. *Promotion:* Route to send promotional messages like coupon codes. Sale Updates, News Updates, etc. This passage is mainly for less important messages. They are usually a little cheaper than Transactional SMS.

---

#### Winding Up the Parameters:

[](#winding-up-the-parameters)

Here is an example on feeding the parameters with Inputs:

```
