{"id":15561095,"url":"https://github.com/mrabbani/laravelsms","last_synced_at":"2025-07-10T13:34:12.462Z","repository":{"id":57020706,"uuid":"55139115","full_name":"mrabbani/LaravelSMS","owner":"mrabbani","description":"SMS Package for Laravel","archived":false,"fork":false,"pushed_at":"2016-10-01T14:28:30.000Z","size":28,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T21:49:46.362Z","etag":null,"topics":["driver-configuration","driver-support","laravel","laravel-sms","laravel5","mail-driver","mobile-phones","sms-messages"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrabbani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-31T09:49:06.000Z","updated_at":"2025-01-12T11:54:36.000Z","dependencies_parsed_at":"2022-08-23T13:50:40.084Z","dependency_job_id":null,"html_url":"https://github.com/mrabbani/LaravelSMS","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mrabbani/LaravelSMS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2FLaravelSMS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2FLaravelSMS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2FLaravelSMS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2FLaravelSMS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrabbani","download_url":"https://codeload.github.com/mrabbani/LaravelSMS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2FLaravelSMS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264585372,"owners_count":23632647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["driver-configuration","driver-support","laravel","laravel-sms","laravel5","mail-driver","mobile-phones","sms-messages"],"created_at":"2024-10-02T16:05:25.022Z","updated_at":"2025-07-10T13:34:12.436Z","avatar_url":"https://github.com/mrabbani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple SMS\n==========\n\n[![Build Status](https://travis-ci.org/SimpleSoftwareIO/simple-sms.svg?branch=master)](https://travis-ci.org/SimpleSoftwareIO/simple-sms)\n[![Latest Stable Version](https://poser.pugx.org/simplesoftwareio/simple-sms/v/stable.svg)](https://packagist.org/packages/simplesoftwareio/simple-sms)\n[![Latest Unstable Version](https://poser.pugx.org/simplesoftwareio/simple-sms/v/unstable.svg)](https://packagist.org/packages/simplesoftwareio/simple-sms)\n[![License](https://poser.pugx.org/simplesoftwareio/simple-sms/license.svg)](https://packagist.org/packages/simplesoftwareio/simple-sms)\n[![Total Downloads](https://poser.pugx.org/simplesoftwareio/simple-sms/downloads.svg)](https://packagist.org/packages/simplesoftwareio/simple-sms)\n\n* [Introduction](#docs-introduction)\n* [Requirements](#docs-requirements)\n* [Configuration](#docs-configuration)\n    * [Call Fire Driver](#docs-call-fire-driver)\n    * [E-mail Driver](#docs-e-mail-driver)\n    * [EZTexting Driver](#docs-ez-texting-driver)\n    * [LabsMobile Driver](#docs-labsmobile-driver)\n    * [Mozeo Driver](#docs-mozeo-driver)\n    * [Nexmo Driver](#docs-nexmo-driver)\n    * [Twilio Driver](#docs-twilio-driver)\n    * [Infobip Driver](#docs-infobip-driver)\n* [Driver Support](#docs-driver-support)\n* [Usage](#docs-usage)\n* [Outgoing Message Enclosure](#docs-outgoing-enclosure)\n* [Incoming Message](#docs-incoming-message)\n\n\u003ca id=\"docs-introduction\"\u003e\u003c/a\u003e\n## Introduction\nSimple SMS is an easy to use package for [Laravel](http://laravel.com/) that adds the capability to send and receive SMS/MMS messages to mobile phones from your web app. It currently supports a free way to send SMS messages through E-Mail gateways provided by the wireless carriers. The package also supports 6 paid services, [Call Fire,](https://www.callfire.com/) [EZTexting,](https://www.eztexting.com) [LabsMobile,](http://www.labsmobile.com) [Mozeo,](https://www.mozeo.com/) [Nexmo,](https://www.nexmo.com/) and [Twilio.](https://www.twilio.com)\n\n\u003ca id=\"docs-requirements\"\u003e\u003c/a\u003e\n## Requirements\n\n#### Laravel 5\n* PHP: \u003e= 5.5\n* Guzzle \u003e= 6.0\n\n\u003ca id=\"docs-configuration\"\u003e\u003c/a\u003e\n## Configuration\n\n#### Laravel 4\n\nPlease read the Laravel 4 [documentation.](https://github.com/SimpleSoftwareIO/simple-sms/blob/master/docs/laravel4.md)\n\n#### Composer\n\nFirst, add the Simple SMS package to your `require` in your `composer/json` file:\n\n`composer require mrabbani/laravel_infobip`\n\nNext, run the `composer update` command.  This will install the package into your Laravel application.\n\n#### Service Provider\n\nOnce you have added the package to your composer file, you will need to register the service provider with Laravel.\n\nAdd `SimpleSoftwareIO\\SMS\\SMSServiceProvider::class` in your `config/app.php` configuration file within the `providers` array.\n\n#### Aliases\n\nFinally, register the Facade.\n\nAdd `'SMS' =\u003e SimpleSoftwareIO\\SMS\\Facades\\SMS::class` in your `config/app.php` configuration file within the `aliases` array.\n\n#### API Settings\n\nYou must run the following command to save your configuration files to your local app:\n\n    php artisan vendor:publish\n\nThis will copy the configuration files to your `config` folder.\n\n\u003eFailure to run the `vendor:publish` command will result in your configuration files being overwritten after every `composer update` command.\n\n#### Driver Configuration\n\n\u003ca id=\"docs-call-fire-driver\"\u003e\u003c/a\u003e\n###### Call Fire Driver\n\nThis driver sends and receives all messages through the [Call Fire](https://www.callfire.com/) service.  It is a very quick and reliable service provider that includes many features such as drip campaigns and voice services.\n\nFill in the `config` file with the correct settings to use this driver.  You can find these settings under your CallFire account and then selecting [API Access.](https://www.callfire.com/ui/manage/access)\n\n    return [\n        'driver' =\u003e 'callfire',\n        'from' =\u003e 'Not Use For Call Fire',\n        'callfire' =\u003e [\n            'app_login' =\u003e 'Your App Login',\n            'app_password' =\u003e 'Your App Password'\n        ],\n    ];\n\n\u003eNote: All messages from CallFire come from the same short number (67076)\n\n\u003ca id=\"docs-e-mail-driver\"\u003e\u003c/a\u003e\n###### E-mail Driver\n\nThe E-Mail driver sends all messages through the configured e-mail driver for Laravel.  This driver uses the wireless carrier's e-mail gateways to send SMS messages to mobile phones. The biggest benefit to using the e-mail driver is that it is completely free to use.\n\nThe only setting for this driver is the `from` setting.  Simply enter an email address that you would like to send messages from.\n\n    return [\n        'driver' =\u003e 'email',\n        'from' =\u003e 'example@example.com',\n    ];\n\n\u003eIf messages are not being sent, ensure that you are able to send E-Mail through Laravel first.\n\nThe following are currently supported by using the e-mail gateway driver.\n\n| Country | Carrier | Carrier Prefix | SMS Supported | MMS Supported | Tested? |\n| --- | --- | --- | --- | --- | --- |\n| USA | AT\u0026T | att | Yes | Yes | Yes |\n| USA | Air Fire Mobile | airfiremobile | Yes | No | No |\n| USA | Alaska Communicates | alaskacommunicates | Yes | Yes | No |\n| USA | Ameritech | ameritech | Yes | No | No |\n| USA | Boost Mobile | moostmobile | Yes | Yes | No |\n| USA | Clear Talk | cleartalk | Yes | No | No |\n| USA | Cricket | cricket | Yes | No | No |\n| USA | Metro PCS | metropcs | Yes | Yes | No |\n| USA | NexTech | nextech | Yes | No | No |\n| Canada | Rogers Wireless | rogerswireless | Yes | Yes | No |\n| USA | Unicel | unicel | Yes | Yes | No |\n| USA | Verizon Wireless | verizonwireless | Yes | Yes | No |\n| USA | Virgin Mobile | virginmobile | Yes | Yes | No |\n| USA | T-Mobile | tmobile | Yes | Yes | Yes |\n\n\u003eYou must know the wireless provider for the mobile phone to use this driver.\n\n\u003eCareful!  Not all wireless carriers support e-mail gateways around the world.\n\n\u003eSome carriers slightly modify messages by adding the `from` and `to` address to the SMS message.\n\n\u003eAn untested gateway means we have not been able to confirm if the gateway works with the mobile provider.  Please provide feedback if you are on one of these carriers.\n\n\u003ca id=\"docs-ez-texting-driver\"\u003e\u003c/a\u003e\n###### EZTexting\n\nThis driver sends all messages through the [EZTexting](https://www.eztexting.com) service.  EZTexting has many different options that have proven to be reliable and fast.\n\nFill in the `config` file with the correct settings to enable EZTexting.\n\n    return [\n        'driver' =\u003e 'eztexting',\n        'from' =\u003e 'Not Use For EZTexting',\n        'eztexting' =\u003e [\n            'username' =\u003e 'Your Username',\n            'password' =\u003e 'Your Password'\n        ],\n    ];\n\nTo enable `receive()` for this service, you must visit the [EZTexting settings page.](https://app.eztexting.com/keywords/index/format/apist)  Enable the `Forwarding API` and `Keyword API` for the messages that you would like forwarded to your web application.\n\n\u003eNote: All messages from EZTexting come from the same short number (313131)\n\n\u003ca id=\"docs-labsmobile-driver\"\u003e\u003c/a\u003e\n###### LabsMobile Driver\n\nThis driver sends all messages through the [LabsMobile](http://www.labsmobile.com/) service.  These settings can be found on your [API Settings](https://www.labsmobile.com/es/login) page.\n\n    return [\n        'driver' =\u003e 'labsmobile',\n        'from' =\u003e 'Sender',\n        'labsmobile' =\u003e [\n            'client' =\u003e 'Your Client Key',\n            'username' =\u003e 'Your Username',\n            'password' =\u003e 'Your Password',\n            'test' =\u003e '1 for simulate mode; 0 for real sendings'\n        ]\n    ];\n\n\u003ca id=\"docs-mozeo-driver\"\u003e\u003c/a\u003e\n###### Mozeo Driver\n\nThis driver sends all messages through the [Mozeo](https://www.mozeo.com/) service.  These settings can be found on your [API Settings](https://www.mozeo.com/mozeo/customer/platformdetails.php) page.\n\n    return [\n        'driver' =\u003e 'mozeo',\n        'from' =\u003e 'Not Used With Mozeo',\n        'mozeo' =\u003e [\n            'companyKey' =\u003e 'Your Company Key',\n            'username' =\u003e 'Your Username',\n            'password' =\u003e 'Your Password'\n        ]\n    ];\n\n\u003eNote: All messages from Mozeo come from the same short number (24587)\n\n\u003ca id=\"docs-nexmo-driver\"\u003e\u003c/a\u003e\n######  Nexmo Driver\n\nThis driver sends messages through the [Nexmo](https://www.nexmo.com/product/messaging/) messaging service.  It is very reliable and capable of sending messages to mobile phones worldwide.\n\n    return [\n        'driver' =\u003e 'nexmo',\n        'from' =\u003e 'Company Name',\n        'nexmo' =\u003e [\n            'key'       =\u003e 'Your Nexmo API Key',\n            'secret'    =\u003e 'Your Nexmo API Secret'\n        ]\n    ];\n\nTo enable `receive()` messages you must set up the [request URL.](https://docs.nexmo.com/index.php/sms-api/handle-inbound-message)\n\n\u003ca id=\"docs-twilio-driver\"\u003e\u003c/a\u003e\n######  Twilio Driver\n\nThis driver sends messages through the [Twilio](https://www.twilio.com/sms) messaging service.  It is very reliable and capable of sending messages to mobile phones worldwide.\n\n    return [\n        'driver' =\u003e 'twilio',\n        'from' =\u003e '+15555555555', //Your Twilio Number in E.164 Format.\n        'twilio' =\u003e [\n            'account_sid' =\u003e 'Your SID',\n            'auth_token' =\u003e 'Your Token',\n            'verify' =\u003e true,  //Used to check if messages are really coming from Twilio.\n        ]\n    ];\n\nIt is strongly recommended to have the `verify` option enabled.  This setting performs an additional security check to ensure messages are coming from Twilio and not being spoofed.\n\nTo enable `receive()` messages you must set up the [request URL.](https://www.twilio.com/user/account/phone-numbers/incoming)  Select the number you wish to enable and then enter your request URL.  This request should be a `POST` request.\n\n\u003ca id=\"docs-infobip-driver\"\u003e\u003c/a\u003e\n######  Infobip Driver\n\nThis driver sends messages through the [Infobib](http://www.infobip.com/en) messaging service.  It is very reliable and capable of sending messages to mobile phones worldwide.\n\n    return [\n        'driver' =\u003e 'infobip',\n        'from' =\u003e 'InfoSMS',\n        'infobip'=\u003e [\n             'username' =\u003e 'username of infobip',\n             'password' =\u003e 'password of infobip'\n         ]\n    ];\nFor more information see [Infobip API Developer Hub](https://dev.infobip.com/)\n\n\u003ca id=\"docs-driver-support\"\u003e\u003c/a\u003e\n##Driver Support\n\nNot all drivers support every method due to the differences in each individual API.  The following table outlines what is supported for each driver.\n\n| Driver | Send | Queue | Pretend | CheckMessages | GetMessage | Receive |\n| --- | --- | --- | --- | --- | --- | --- |\n| Call Fire | Yes | Yes | Yes | Yes | Yes | No |\n| E-Mail | Yes | Yes | Yes | No | No | No |\n| EZTexting | Yes | Yes | Yes | Yes | Yes | Yes |\n| LabsMobile | Yes | Yes | Yes | No | No | No |\n| Mozeo | Yes | Yes | Yes | No | No | No |\n| Nexmo | Yes | Yes | Yes | Yes | Yes | Yes |\n| Twilio | Yes | Yes | Yes | Yes | Yes | Yes |\n\n\u003ca id=\"docs-usage\"\u003e\u003c/a\u003e\n## Usage\n\n#### Basic Usage\n\nSimple SMS operates in much of the same way as the Laravel Mail service provider.  If you are familiar with this then SMS should feel like home.  The most basic way to send a SMS is to use the following:\n\n    //Service Providers Example\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\n    //Email Driver Example\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555', 'att');\n    });\n\nThe first parameter is the view file that you would like to use.  The second is the data that you wish to pass to the view.  The final parameter is a callback that will set all of the options on the `message` closure.\n\n#### Send\n\nThe `send` method sends the SMS through the configured driver using a Laravel view file.\n\n    SMS::send($view, Array $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    }\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\nIt is possible to send a simple message without creating views by passing a string instead of a view.\n\n    SMS::send($message, [], function($sms) {\n        $sms-\u003eto('+15555555555');\n    }\n    SMS::send('This is my message', [], function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\n#### Driver\n\nThe `driver` method will switch the provider during runtime.\n\n    //Will send through default provider set in the config file.\n    SMS::queue('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\n    SMS::driver('twilio');\n\n    //Will send through Twilio\n    SMS::queue('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\n#### Queue\n\nThe `queue` method queues a message to be sent later instead of sending the message instantly.  This allows for faster respond times for the consumer by offloading uncustomary processing time. Like `Laravel's Mail` system, queue also has `queueOn,` `later,` and `laterOn` methods.\n\n    SMS::queue('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\n\u003eThe `queue` method will fallback to the `send` method if a queue service is not configured within `Laravel.`\n\n#### Pretend\n\nThe `pretend` method will simply create a log file that states that a SMS message has been \"sent.\"  This is useful to test to see if your configuration settings are working correctly without sending actual messages.\n\n    SMS::pretend('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n    });\n\nYou may also set the `pretend` configuration option to true to have all SMS messages pretend that they were sent.\n\n    `/app/config/simplesoftwareio/simple-sms/config.php`\n    return array(\n        'pretend' =\u003e true,\n    );\n\n#### Receive\n\nSimple SMS supports push SMS messages.  You must first configure this with your service provider by following the configuration settings above.\n\n    Route::post('sms/receive', function()\n    {\n        SMS::receive();\n    }\n\nThe receive method will return a `IncomingMessage` instance.  You may request any data off of this instance like:\n\n    Route::post('sms/receive', function()\n    {\n        $incoming = SMS::receive();\n        //Get the sender's number.\n        $incoming-\u003efrom();\n        //Get the message sent.\n        $incoming-\u003emessage();\n        //Get the to unique ID of the message\n        $incoming-\u003eid();\n        //Get the phone number the message was sent to\n        $incoming-\u003eto();\n        //Get the raw message\n        $incoming-\u003eraw();\n    }\n\nThe `raw` method returns all of the data that a driver supports.  This can be useful to get information that only certain service providers provide.\n\n    Route::post('sms/receive', function()\n    {\n        $incoming = SMS::receive();\n        //Twilio message status\n        echo $incoming-\u003eraw()['status'];\n    }\n\nThe above would return the status of the message on the Twilio driver.\n\n\u003eData used from the `raw` method will not work on other service providers.  Each provider has different values that are sent out with each request.\n\n#### Check Messages\n\nThis method will retrieve an array of messages from the service provider.  Each message within the array will be an `IncomingMessage` object.\n\n    $messages = SMS::checkMessages();\n    foreach ($messages as $message)\n    {\n        //Will display the message of each retrieve message.\n        echo $message-\u003emessage();\n    }\n\nThe `checkMessages` method supports has an `options` variable to pass some settings onto each service provider. See each service providers API to see which `options` may be passed.\n\nMore information about each service provider can be found at their API docs.\n\n* [Call Fire](https://www.callfire.com/api-documentation/rest/version/1.1#!/text/QueryTexts_get_1)\n* [EZTexting](https://www.eztexting.com/developers/sms-api-documentation/rest)\n* [LabsMobile](http://www.labsmobile.com/en/api-sms)\n* [Mozeo](https://www.mozeo.com/mozeo/customer/Mozeo_API_OutboundSMS.pdf)\n* [Nexmo](https://docs.nexmo.com/index.php/developer-api/search-message)\n* [Twilio](https://www.twilio.com/docs/api/rest/message#list-get)\n* [Infobip](https://dev.infobip.com/)\n\n#### Get Message\n\nYou are able to retrieve a message by it's ID with a simply call.  This will return an IncomingMessage object.\n\n    $message = SMS::getMessage('aMessageId');\n    //Prints who the message came from.\n    echo $message-\u003efrom();\n\n\u003ca id=\"docs-outgoing-enclosure\"\u003e\u003c/a\u003e\n## Outgoing Message Enclosure\n\n#### Why Enclosures?\n\nWe use enclosures to allow for functions such as the queue methods.  Being able to easily save the message enclosures allows for much greater flexibility.\n\n#### To\n\nThe `to` method adds a phone number that will have a message sent to it.\n\n    //Service Providers Example\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('+15555555555');\n        $sms-\u003eto('+14444444444');\n    });\n    //Email Driver\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eto('15555555555', 'att);\n        $sms-\u003eto('14444444444', 'verizonwireless);\n    });\n\n\u003eThe carrier is required for the email driver so that the correct email gateway can be used.  See the table above for a list of accepted carriers.\n\n#### From\n\nThe `from` method will set the address from which the message is being sent.\n\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003efrom('+15555555555');\n    });\n\n#### attachImage\n\nThe `attachImage` method will add an image to the message.  This will also convert the message to a MMS because SMS does not support image attachments.\n\n    //Email Driver\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eattachImage('/local/path/to/image.jpg');\n    });\n    //Twilio Driver\n    SMS::send('simple-sms::welcome', $data, function($sms) {\n        $sms-\u003eattachImage('/url/to/image.jpg');\n    });\n\n\u003eCurrently only supported with the E-Mail and Twilio Driver.\n\n\u003ca id=\"docs-incoming-message\"\u003e\u003c/a\u003e\n## Incoming Message\n\nAll incoming messages generate a `IncomingMessage` object.  This makes it easy to retrieve information from them in a uniformed way across multiple service providers.\n\n#### Raw\n\nThe `raw` method returns the raw data provided by a service provider.\n\n    $incoming = SMS::getMessage('messageId');\n    echo $incoming-\u003eraw()['status'];\n\n\u003eEach service provider has different information in which they supply in their requests.  See their documentations API for information on what you can get from a `raw` request.\n\n#### From\n\nThis method returns the phone number in which a message came from.\n\n    $incoming = SMS::getMessage('messageId');\n    echo $incoming-\u003efrom();\n\n#### To\n\nThe `to` method returns the phone number that a message was sent to.\n\n    $incoming = SMS::getMessage('messageId');\n    echo $incoming-\u003eto();\n\n#### Id\n\nThis method returns the unique id of a message.\n\n    $incoming = SMS::getMessage('messageId');\n    echo $incoming-\u003eid();\n\n#### Message\n\nAnd the best for last; this method returns the actual message of a SMS.\n\n    $incoming = SMS::getMessage('messageId');\n    echo $incoming-\u003emessage();\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrabbani%2Flaravelsms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrabbani%2Flaravelsms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrabbani%2Flaravelsms/lists"}