smstraffic-api-laravel maintained by danbka33
Description
SMS Traffic API implementation with Laravel support
Authors
Last update
2024/02/21 04:40
(dev-master)
License
Downloads
118
SMS Traffic API with Laravel Support
SMS Traffic is full-cycle SMS aggregator. This project is an implementation of API by HTTP Protocol.
Install via composer
composer require danbka33/smstraffic-api-laravel
This package makes use of Laravels package auto-discovery mechanism.
If for some reason you want manually control this:
- add the package to the
extra.laravel.dont-discoverkey incomposer.json, e.g."extra": { "laravel": { "dont-discover": [ "danbka33/smstraffic-api-laravel" ] } } - Add the following class to the
providersarray inconfig/app.php:\Danbka33\SmsTrafficApi\Providers\SmsTrafficServiceProvider::class,
Environment Variables
SMS_TRAFFIC_LOGIN=login
SMS_TRAFFIC_PASSWORD=password
SMS_TRAFFIC_ORIGINATOR=originator
Lumen
To use the included config, copy it over to your config folder.
mkdir -p config
cp vendor/danbka33/smstraffic-api-laravel/src/config/sms-traffic.php config/
Register the config file within your bootstrap/app.php file:
$app->configure('sms-traffic');
Register the service provider in your bootstrap/app.php file:
$app->register(\Danbka33\SmsTrafficApi\Providers\SmsTrafficServiceProvider::class);
Usage
use Danbka33\SmsTrafficApi\Client;
use Danbka33\SmsTrafficApi\Sms\Sms;
$client = app()->get(Client::class);
$result = $client->send(new Sms($phone, $message));
Publish default config file
php artisan vendor:publish --tag=sms-traffic-config
return [
'login' => env('SMS_TRAFFIC_LOGIN', ''),
'password' => env('SMS_TRAFFIC_PASSWORD', ''),
'originator' => env('SMS_TRAFFIC_ORIGINATOR', ''),
];
License
The SMS Traffic API with Laravel Support is open-sourced software licensed under the MIT license