xxc / smsgateway-sender
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.5.9
- guzzlehttp/guzzle: ^6.2
- illuminate/config: ^5.0
- illuminate/support: ^5.0
Requires (Dev)
- mockery/mockery: ^1.2
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-12-21 21:20:16 UTC
README
###Package for the AMDTelecom SMSGateway This package is for standard php project use, but has optimisations for laravel usage.
##Installation composer require xxc/smsgateway-sender
for laravel if you're not using package discovery add
xXc\SmsGatewaySender\SmsGatewaySenderServiceProvider::class
to config/app.php
##Usage
Desired usage
try { $smsGatewaySender = new \xXc\SmsGatewaySender(); $response = $smsGatewaySender ->from('') ->to('') ->message('') ->send(); if ($response->isSent()) { //do whatever } else { //log errors $response->errors //return error message } } catch (\Exception $exception) { //log data //return error based on the exception message?! }
overriding with custom validators can be done via the constructor or via the setters All the custom validator must extend the Validator interface
$smsGatewaySender = new \xXc\SmsGatewaySender($customPhoneValidator, $customMessageValidator); \\or $smsGatewaySender = new \xXc\SmsGatewaySender(); $smsGatewaySender->setPhoneValidator($customPhoneValidator); $smsGatewaySender->setMessageValidator($customMessageValidator);
to publish the config
php artisan vendor:publish
then choose the xXc\SmsServiceProvider tag
Contributing: You can create custom validators for phone numbers or text messages (if needed) and create pull requests