You can install the package via composer:
composer require riotj/osonsms-gateway
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('xxxxxxxxx', '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@rio.tj.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email info@rio.tj 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.