danbka33 / smstraffic-api-laravel
SMS Traffic API implementation with Laravel support
v1.0.4
2024-02-21 03:40 UTC
Requires
- php: >=5.5
- ext-libxml: *
- ext-pcre: *
- guzzlehttp/guzzle: ~7.0 || ~6.0
- illuminate/contracts: 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10
- illuminate/support: 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10
Requires (Dev)
- laravel/framework: ^10.0
- phpunit/phpunit: ^7.5 || ^8.4 || ^9 || ^10
This package is auto-updated.
Last update: 2025-06-21 06:32:33 UTC
README
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-discover
key incomposer.json
, e.g."extra": { "laravel": { "dont-discover": [ "danbka33/smstraffic-api-laravel" ] } }
- Add the following class to the
providers
array 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