Skip to content

Commit a647d00

Browse files
author
Mohammad Kawsara
committed
initial Release
0 parents  commit a647d00

11 files changed

+575
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
vendor/
3+
composer.lock
4+
.DS_Store

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## v1.0.0
2+
* Initial Release

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing
2+
3+
First of all, **thank you** for contributing!
4+
5+
Here are a few rules to follow in order to ease code reviews and merging:
6+
7+
- Follow [PSR-1](http://www.php-fig.org/psr/1/) and [PSR-2](http://www.php-fig.org/psr/2/)
8+
- Run the test suite
9+
- Write (or update) unit tests when applicable
10+
- Write documentation for new features
11+
- Use [commit messages that make sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
12+
13+
One may ask you to [squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) too. This is used to "clean" your pull request before merging it (we don't want commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
14+
15+
When creating your pull request on GitHub, please write a description which gives the context and/or explains why you are creating it.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Mohamed Kawsara - Liliom <info@liliom.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Laravel 5.x Unifonic
2+
Start sending SMS and making Voice calls with Unifonic right away using Laravel.
3+
4+
<p align="center">
5+
<img src="http://unifonic.com/wp-content/uploads/2016/08/logo-1.png">
6+
</p>
7+
8+
<p align="center">
9+
<a href="https://packagist.org/packages/liliom/laravel-unifonic"><img src="https://poser.pugx.org/liliom/laravel-unifonic/d/total.svg" alt="Total Downloads"></a>
10+
<a href="https://packagist.org/packages/liliom/laravel-unifonic"><img src="https://poser.pugx.org/liliom/laravel-unifonic/v/stable.svg" alt="Latest Stable Version"></a>
11+
<a href="https://packagist.org/packages/liliom/laravel-unifonic"><img src="https://poser.pugx.org/liliom/laravel-unifonic/license.svg" alt="License"></a>
12+
</p>
13+
14+
---
15+
## Installation
16+
17+
First, install the package through Composer.
18+
19+
```sh
20+
$ composer require liliom/laravel-unifonic
21+
```
22+
23+
#### Laravel 5.5 and up
24+
25+
You don't have to do anything else, this package uses the Package Auto-Discovery feature, and should be available as soon as you install it via Composer.
26+
27+
#### Laravel 5.4 and down
28+
29+
Then include the service provider inside `config/app.php`.
30+
31+
```php
32+
'providers' => [
33+
...
34+
Liliom\Unifonic\UnifonicServiceProvider::class,
35+
...
36+
];
37+
```
38+
And add the alias as well
39+
40+
```php
41+
'aliases' => [
42+
...
43+
'Unifonic' => Liliom\Unifonic\UnifonicFacade::class,
44+
...
45+
],
46+
```
47+
48+
####Configurations:
49+
Add to your `config/services.php` a new array as the following
50+
```
51+
'unifonic' => [
52+
'app_id' => env('UNIFONIC_APP_SID'),
53+
'sender_id' => env('UNIFONIC_SENDER_ID') //optional
54+
],
55+
```
56+
57+
If you don't want to publish the configs add Unifonic App Sid within your `.env` file
58+
59+
```
60+
UNIFONIC_APP_SID={YOUR_DEFAULT_APP_ID}
61+
```
62+
63+
---
64+
### Usage
65+
66+
####Account related methods:
67+
```php
68+
Unifonic::getBalance();
69+
Unifonic::addSenderID(string $senderID);
70+
71+
// To test credentials and make sure the APP ID is configured correctly.
72+
Unifonic::testCredentials();
73+
```
74+
75+
####Messages related methods:
76+
```php
77+
Unifonic::send(int $recipient, string $message, string $senderID = null);
78+
Unifonic::sendBulk(array $recipients, string $message, string $senderID = null);
79+
Unifonic::getMessageIDStatus(int $messageID);
80+
Unifonic::getMessagesReport($dateFrom = null, $dateTo = null, string $senderId = null, string $status = null, string $delivery = null);
81+
```
82+
83+
You may make asynchronous calls to Unifonic API, by prefixing your methods with the `async()` function:
84+
```php
85+
86+
Unifonic::async(true) // async calls on, default value is true
87+
Unifonic::async(false) // async calls off
88+
89+
// Later you can append the callback() to be executed when the response returns.
90+
Unifonic::async()->callback(Callable $requestCallback)
91+
92+
```
93+
94+
95+
For more details about the parameters please refer to the [Api Documentation](http://docs.unifonic.apiary.io/) for more info, or read the [source code](https://github.com/liliomlab/laravel-unifonic/blob/master/src/UnifonicClient.php).
96+
97+
98+
## Contributing
99+
See the [CONTRIBUTING](CONTRIBUTING.md) guide.
100+
101+
### Change Log
102+
See the [log](CHANGELOG.md) file.

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "liliom/laravel-unifonic",
3+
"description": "A wrapper around the PHP SDK of Unifonic. Sending SMS, making Voice and VOIP calls, TTS calls, and 2FA",
4+
"keywords": [
5+
"laravel",
6+
"unifonic",
7+
"sms",
8+
"voice",
9+
"2FA",
10+
"verify",
11+
"number intelligence",
12+
"text-to-speech",
13+
"tts",
14+
"voip",
15+
"api"
16+
],
17+
"require": {
18+
"php": ">=7.1.0",
19+
"ext-curl": "*"
20+
},
21+
"require-dev": {
22+
"laravel/framework": ">=5.3",
23+
"guzzlehttp/guzzle": "^6.2",
24+
"vlucas/phpdotenv": "^2.2"
25+
},
26+
"license": "MIT",
27+
"authors": [
28+
{
29+
"name": "Mohammad Kawsara",
30+
"email": "mkwsra@gmail.com"
31+
}
32+
],
33+
"autoload": {
34+
"psr-4": {
35+
"Liliom\\Unifonic\\": "src/"
36+
}
37+
},
38+
"extra": {
39+
"laravel": {
40+
"providers": [
41+
"Liliom\\Unifonic\\UnifonicServiceProvider"
42+
],
43+
"aliases": {
44+
"Unifonic": "Liliom\\Unifonic\\UnifonicFacade"
45+
}
46+
}
47+
},
48+
"minimum-stability": "dev"
49+
}

0 commit comments

Comments
 (0)