https://github.com/mediumart/orange
A laravel adapter for orange api services
https://github.com/mediumart/orange
laravel orange orange-api php sms
Last synced: about 1 year ago
JSON representation
A laravel adapter for orange api services
- Host: GitHub
- URL: https://github.com/mediumart/orange
- Owner: mediumart
- License: mit
- Created: 2017-06-26T20:49:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T13:16:10.000Z (over 4 years ago)
- Last Synced: 2025-04-01T10:03:25.393Z (about 1 year ago)
- Topics: laravel, orange, orange-api, php, sms
- Language: PHP
- Size: 81.1 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# mediumart orange
[](https://travis-ci.org/mediumart/orange)
[](https://coveralls.io/github/mediumart/orange?branch=master)
[](https://packagist.org/packages/mediumart/orange)
[](https://packagist.org/packages/mediumart/orange)
## Description
A laravel wrapper/adapter for orange api services.
## Installation
Using composer:
```
$ composer require mediumart/orange
```
If you are using laravel 5.3+ prior to version 5.5, add this to your `config/app.php` inside the `'providers'` array
```php
Mediumart\Orange\OrangeServiceProvider::class
```
## SMS Api
### Configuration
Open the `config/services.php` and add a key for the `orange>sms` service like this:
'orange' => [
'sms' => [
'client_id' => '',
'client_secret' => ''
]
]
Using these credentials, a `token` will be *fetched* and *cached*, and then automatically be *renewed* a few days before its expiration.
### How to use
You can resolve an `SMS` client instance from the `Container` like this:
```php
$sms = app('orange-sms');
```
Or using type hinting
```php
use Mediumart\Orange\SMS\SMS;
public function index(SMS $sms)
{
/.../
}
```
The documentation on how to use the `$sms` client instance can be found [here](https://github.com/mediumart/orange-sms)
## License
Mediumart orange is an open-sourced software licensed under the [MIT license](https://github.com/mediumart/orange/blob/master/LICENSE.txt).