osonsms/gateway

A simple library for sending SMS via OsonSMS API.

1.1.8 2021-04-03 05:53 UTC

This package is auto-updated.

Last update: 2021-09-03 06:53:49 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Installation

You can install the package via composer:

composer require osonsms/gateway

Usage

Run following command to publish a migration file:

php artisan vendor:publish --provider="OsonSMS\SMSGateway\SMSGatewayServiceProvider" --tag="migrations"

Run php artisan migrate to create a necessary package table.

To create a config file in order to specify OsonSMS credentials run following command:

php artisan vendor:publish --provider="OsonSMS\SMSGateway\SMSGatewayServiceProvider" --tag="config"

Open config/smsgateway.php config file and specify following parameters:

  • login - Login from OsonSMS
  • hash - Hash string
  • sender_name - SMS Sender Name assigned to you

You can send SMS in your Laravel code using folowing code:

$txn_id = uniqid();
$result = SMSGateway::Send('927777777', 'This is my test message from Laravel!', $txn_id);
if ($result)
    echo "SMS has been sent succesfully";
else
    echo "When sending SMS an error occurred";

You can find the logs of your SMS in the table called osonsms_log.

To check your balance use following code SMSGateway::getBalance() which returns a decimal number, indicating your balance in Somoni.

If you have any further questions or recommendations, feel free to send us an email at info@osonsms.com.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email i@bakhtiyor.tj instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.