The Service Has STOPPED!
Laravel OurSMS API Integration
- Require the package into your Laravel application:
$ composer require munafio/oursms-laravel
- Install OurSMS using the following artisan command:
$ php artisan oursms:install
this will publish the configurations and create oursms
environment variables inside your application's .env
file and setups everything for you.
- Modify the following variables in your application's
.env
with your OurSMS Account's credentials:
...
OURSMS_USER_ID=
OURSMS_SECRET_KEY=
That's it, enjoy :)
you can easily use this package inside your application, all you need is to import package's facade
anywhere inside your application (e.g. inside the controllers) as the following:
use Munafio\OurSMS\Facades\OurSMS;
or, you can use it directly without importing the facade
as the following:
...
public function example(Request $request){
...
OurSMS::sendOSM(...,...);
...
}
...
OurSMS::sendOSM($phoneNumber, $message);
OurSMS::sendOTP($phoneNumber, $message);
OurSMS::getStatus($messageId);
You can find the configurations file at config/oursms.php
in your application, which contains the following properties:
/*
|-------------------------------------
| OurSMS service credentials
|-------------------------------------
*/
'user_id' => env('OURSMS_USER_ID', null),
'secret_key' => env('OURSMS_SECRET_KEY', null),
user_id
you own user id in the website.secret_key
your own secret key you can find it next to theuser id
in the website.
/*
|-------------------------------------
| OurSMS service API base_uri
|-------------------------------------
*/
'base_uri' => 'https://oursms.app/api/v1/SMS'
base_uri
is the base url ofOurSMS
service's endpoints.