PHPackages                             osonsms/gateway - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. osonsms/gateway

ActiveLibrary[HTTP &amp; Networking](/categories/http)

osonsms/gateway
===============

A simple library for sending SMS via OsonSMS API.

3.0.0(4mo ago)4468↓50%MITPHPPHP ^8.0

Since Dec 6Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/bakhtiyor/osonsms-gateway)[ Packagist](https://packagist.org/packages/osonsms/gateway)[ Docs](https://github.com/osonsms/smsgateway)[ RSS](/packages/osonsms-gateway/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (0)

OsonSMS package for sending SMS
===============================

[](#osonsms-package-for-sending-sms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/725dff1c83f0b357acdacd164d7a8cf6ab0bf73e27f18bf4a60215fc13a3a1b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f736f6e736d732f676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/osonsms/gateway)[![Total Downloads](https://camo.githubusercontent.com/c92fa1beb978cace47e037228695b7bbf69c90d7601c6c3c683e84c96feb4703/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f736f6e736d732f676174657761792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/osonsms/gateway)

Here you can find a short instruction of how to install and use this package.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require osonsms/gateway
```

Usage
-----

[](#usage)

Run following command to publish a migration file:

```
php artisan vendor:publish --provider="OsonSMS\OsonSMSService\OsonSmsServiceProvider" --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\OsonSMSService\OsonSmsServiceProvider" --tag="config"
```

Open `config/osonsmsservice.php` config file and specify following parameters:

- login - Your login in OsonSMS platform
- bearer\_token - Your Bearer token from OsonSMS platform (obtained after registration)
- sender\_name - SMS Sender Name assigned to you

Below you can find a console command created in Laravel in order to test OsonSMS service. Create a command using `php artisan make:command TestOsonSMSServiceCommand` in order to create a test command. Find it in the project folder and copy paste following code.

```
