Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enniel/ami-hook
[WIP] Webhook API for Asterisk AMI.
https://github.com/enniel/ami-hook
ami asterisk laravel webhooks
Last synced: 9 days ago
JSON representation
[WIP] Webhook API for Asterisk AMI.
- Host: GitHub
- URL: https://github.com/enniel/ami-hook
- Owner: enniel
- License: mit
- Created: 2017-02-02T10:37:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-03T09:58:41.000Z (almost 8 years ago)
- Last Synced: 2024-11-06T08:08:02.815Z (about 2 months ago)
- Topics: ami, asterisk, laravel, webhooks
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ami-hook
Webhook API for Asterisk AMI.
## Install
Via Composer
``` bash
$ composer require enniel/ami-hook
```Add the service provider to your `config/app.php`:
```php
...
'providers' => [
...
Enniel\AmiHook\AmiHookServiceProvider::class,
],
...
```Publish and run the migration to create the `webhooks` table that will hold all installed webhooks.
```sh
php artisan vendor:publish --provider="Mpociot\CaptainHook\CaptainHookServiceProvider"php artisan migrate
```For more information about webhooks see [mpociot/captainhook][link-captain-webhook-package].
Next, you should call the `AmiHook::routes` method within the boot method of your `RouteServiceProvider`. This method will register webhook routes:
```php
mapApiRoutes();
$this->mapWebRoutes();
//
}/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
require base_path('routes/web.php');
});
}/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
AmiHook::routes(null, [
'middleware' => 'auth:api',
'prefix' => 'api',
]);Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
});
}
}```
## ContributingPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Evgeny Razumov][link-author]
- [All Contributors][link-contributors]## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/enniel/ami-hook.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/enniel/ami-hook/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/enniel/ami-hook.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/enniel/ami-hook.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/enniel/ami-hook.svg?style=flat-square[link-packagist]: https://packagist.org/packages/enniel/ami-hook
[link-travis]: https://travis-ci.org/enniel/ami-hook
[link-scrutinizer]: https://scrutinizer-ci.com/g/enniel/ami-hook/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/enniel/ami-hook
[link-downloads]: https://packagist.org/packages/enniel/ami-hook
[link-author]: https://github.com/enniel
[link-contributors]: ../../contributors
[link-captain-webhook-package]: https://github.com/mpociot/captainhook