A simple library for sending SMS via OsonSMS API.
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.
You can install the package via composer:
composer require osonsms/gateway
Run following command to publish a migration file:
php artisan vendor:publish --provider="OsonSMS\SMSGateway\SMSGatewayServiceProvider" --tag="migrations"
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
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 email@example.com.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.