generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,219 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github: :vendor_name | ||
github: omakei |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Ask a question | ||
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a | ||
url: https://github.com/omakei/laravel-nextsms/discussions/new?category=q-a | ||
about: Ask the community for help | ||
- name: Request a feature | ||
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas | ||
url: https://github.com/omakei/laravel-nextsms/discussions/new?category=ideas | ||
about: Share ideas for new features | ||
- name: Report a security issue | ||
url: https://github.com/:vendor_name/:package_name/security/policy | ||
url: https://github.com/omakei/laravel-nextsms/security/policy | ||
about: Learn how to notify us for sensitive bugs | ||
- name: Report a bug | ||
url: https://github.com/:vendor_name/:package_name/issues/new | ||
url: https://github.com/omakei/laravel-nextsms/issues/new | ||
about: Report a reproducable bug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Security Policy | ||
|
||
If you discover any security related issues, please email author@domain.com instead of using the issue tracker. | ||
If you discover any security related issues, please email omakei96@gmail.com instead of using the issue tracker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,236 @@ | ||
# :package_description | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug) | ||
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain) | ||
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug) | ||
<!--delete--> | ||
--- | ||
This repo can be used to scaffold a Laravel package. Follow these steps to get started: | ||
<p align="center"> | ||
<img src="/art/nextsms-logo.png" width="1352" title="NextSMS Logo" alt="NextSMS Logo"> | ||
</p> | ||
# Laravel NextSMS | ||
|
||
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton | ||
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files | ||
3. Remove this block of text. | ||
4. Have fun creating your package. | ||
5. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course. | ||
--- | ||
<!--/delete--> | ||
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. | ||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/omakei/laravel-nextsms.svg?style=flat-square)](https://packagist.org/packages/omakei/laravel-nextsms) | ||
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/omakei/laravel-nextsms/run-tests?label=tests)](https://github.com/omakei/laravel-nextsms/actions?query=workflow%3Arun-tests+branch%3Amain) | ||
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/omakei/laravel-nextsms/Check%20&%20fix%20styling?label=code%20style)](https://github.com/omakei/laravel-nextsms/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/omakei/laravel-nextsms.svg?style=flat-square)](https://packagist.org/packages/omakei/laravel-nextsms) | ||
|
||
## Support us | ||
|
||
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name) | ||
|
||
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). | ||
|
||
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). | ||
Laravel package to send SMS using NextSMS API. | ||
|
||
## Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require :vendor_slug/:package_slug | ||
``` | ||
|
||
You can publish and run the migrations with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag=":package_slug-migrations" | ||
php artisan migrate | ||
composer require omakei/laravel-nextsms | ||
``` | ||
|
||
You can publish the config file with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag=":package_slug-config" | ||
php artisan vendor:publish --tag="laravel-nextsms-config" | ||
``` | ||
|
||
Optionally, you can publish the views using | ||
The following keys must be available in your `.env` file: | ||
|
||
```bash | ||
php artisan vendor:publish --tag=":package_slug-views" | ||
NEXTSMS_USERNAME= | ||
NEXTSMS_PASSWORD= | ||
NEXTSMS_SENDER_ID= | ||
``` | ||
|
||
This is the contents of the published config file: | ||
This is the contents of the published `config` file: | ||
|
||
```php | ||
return [ | ||
'username' => env('NEXTSMS_USERNAME', 'NEXTSMS'), | ||
'password' => env('NEXTSMS_PASSWORD', 'NEXTSMS'), | ||
'api_key' => base64_encode(env('NEXTSMS_USERNAME', 'NEXTSMS').':'.env('NEXTSMS_PASSWORD', 'NEXTSMS')), | ||
'sender_id' => env('NEXTSMS_SENDER_ID', 'NEXTSMS'), | ||
'url' => [ | ||
'sms' => [ | ||
'single' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/text/single', | ||
'multiple' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/text/multi', | ||
'reports' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/reports', | ||
'logs' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/logs', | ||
'balance' => NextSMS::NEXTSMS_BASE_URL.'/api/sms/v1/balance', | ||
], | ||
'sub_customer' => [ | ||
'create' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/create', | ||
'recharge' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/recharge', | ||
'deduct' => NextSMS::NEXTSMS_BASE_URL.'/api/reseller/v1/sub_customer/deduct', | ||
] | ||
], | ||
]; | ||
``` | ||
|
||
## Usage | ||
|
||
### Send SMS | ||
|
||
Sending single sms to single destination: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::sendSingleSMS(['to' => '255625933171', 'text' => 'Dj Omakei is texting.']); | ||
|
||
``` | ||
|
||
Sending single sms to multiple destinations: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::sendSingleSMSToMultipleDestination([ | ||
'to' => ['255625933171','255656699895'], | ||
'text' => 'Dj Omakei is texting.']); | ||
|
||
``` | ||
|
||
Sending multiple sms to multiple destinations (Example 1): | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::sendMultipleSMSToMultipleDestinations(['messages' => [ | ||
['to' => '255625933171', 'text' => 'Dj Omakei is texting.'], | ||
['to' => '255656699895', 'text' => 'Dj Omakei is texting.'] | ||
]]); | ||
|
||
``` | ||
|
||
Sending multiple sms to multiple destinations (Example 2): | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::sendMultipleSMSToMultipleDestinations(['messages' => [ | ||
['to' => ['255625933171','255656699895'], 'text' => 'Dj Omakei is texting.'], | ||
['to' => '255625933171', 'text' => 'Dj Omakei is texting.'] | ||
]]); | ||
|
||
``` | ||
|
||
Schedule sms: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::scheduleSMS([ | ||
'to' => '255625933171', | ||
'text' => 'Dj Omakei is texting.', | ||
'date' => '2022-01-25' , | ||
'time' => '12:00']); | ||
|
||
``` | ||
|
||
### SMS Delivery Reports | ||
|
||
Get all delivery reports: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getAllDeliveryReports(); | ||
|
||
``` | ||
|
||
Get delivery reports with messageId: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getDeliveryReportWithMessageId(243452542526627); | ||
|
||
``` | ||
|
||
Get delivery reports with messageId: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getDeliveryReportWithSpecificDateRange('2022-01-25', '2022-01-29'); | ||
|
||
``` | ||
|
||
### Sent Sms Logs | ||
|
||
Get all sent SMS logs: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getAllSentSMSLogs(10, 5); | ||
|
||
``` | ||
|
||
Get all sent SMS logs with the optional parameter: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getAllSentSMSLogsWithOptionalParameter('255625933171','2022-01-25', '2022-01-29',10, 5); | ||
|
||
``` | ||
|
||
### Sub Customer | ||
|
||
Register Sub Customer: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::subCustomerCreate( | ||
'Michael', | ||
'Omakei', | ||
'omakei', | ||
'[email protected]', | ||
'06259313171', | ||
'Sub Customer (Reseller)', | ||
100); | ||
|
||
``` | ||
|
||
Recharge customer: | ||
|
||
```php | ||
$skeleton = new VendorName\Skeleton(); | ||
echo $skeleton->echoPhrase('Hello, VendorName!'); | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::subCustomerRecharge('[email protected]', 100); | ||
|
||
``` | ||
|
||
Deduct a customer: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::subCustomerDeduct('[email protected]', 100); | ||
|
||
``` | ||
|
||
Get sms balance: | ||
|
||
```php | ||
|
||
use Omakei\NextSMS\NextSMS; | ||
|
||
$response = NextSMS::getSMSBalance(); | ||
|
||
``` | ||
|
||
## NextSMS API Documentation | ||
|
||
Please see [NextSMS Developer API](https://documenter.getpostman.com/view/4680389/SW7dX7JL#2936eed4-6027-45e7-92c9-fe1cd7df140b) for more details. | ||
|
||
## Testing | ||
|
||
```bash | ||
|
@@ -86,7 +251,7 @@ Please review [our security policy](../../security/policy) on how to report secu | |
|
||
## Credits | ||
|
||
- [:author_name](https://github.com/:author_username) | ||
- [omakei](https://github.com/omakei) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.