From 5861272b88af56d959252f0b67148c18697157ed Mon Sep 17 00:00:00 2001 From: changhuapeng Date: Fri, 1 Apr 2016 22:09:01 +0800 Subject: [PATCH] Update readme.md Add installation and documentation details --- readme.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 49494e1..c806859 100644 --- a/readme.md +++ b/readme.md @@ -2,12 +2,40 @@ Provides an implementation for the TransmitSMS-API as used by BurstSMS (burstsms.com.au) -Original class was developed by BurstSMS and this is just a package of their class and is not an official module it is something I packaged up to make it easier for using their system in Laravel 4. +Original class was developed by BurstSMS and packaged by abreeden for use in Laravel 4. This package have been update for **Laravel 5**. + +## Installation + +Once you have installed this package, you will need to add the service provider to the `providers` array in `app.php` config file: + + Abreeden\TransmitsmsApi\TransmitsmsApiServiceProvider +or + + Abreeden\TransmitsmsApi\TransmitsmsApiServiceProvider::class + +Next, you may want to add the TransmitSMS facade. To do that, you will need to add under the `aliases` array, also in the `app.php` config file: + + 'TransmitSMS' => Abreeden\TransmitsmsApi\Facades\TransmitsmsApiFacade +or + + 'TransmitSMS' => Abreeden\TransmitsmsApi\Facades\TransmitsmsApiFacade::class + +Finally, you will need to publish the config file using the following command: + + $ php artisan vendor:publish --provider="Abreeden\TransmitsmsApi\TransmitsmsApiServiceProvider" + +**Remember to set your API and secret keys in the config file or .env file!** ## Documentation -To send a message you will require an account with a provider using the TransmitSMS API such as BurstSMS. Use the following syntax to initialise and send a message in Laravel 4. +To send a message you will require an account with a provider using the TransmitSMS API such as BurstSMS. Use the following syntax to initialise and send a message in Laravel 5. + +Without facade: - $sms = new \Abreeden\TransmitsmsApi\TransmitsmsApi("API_KEY",'API_Secret'); - $result=$sms->sendSms("Message goes here","Destination Number","From"); + $sms = new \Abreeden\TransmitsmsApi\TransmitsmsApi("API_KEY", "SECRET"); + $result = $sms->sendSms("Message goes here", "Destination Number", "From"); + +With facade: + + $result = \TransmitSMS::sendSms("Message goes here", "Destination Number", "From");