Skip to content

Commit

Permalink
Merge branch 'release/v1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
lostincode committed Feb 10, 2017
2 parents c32dd7d + 1111a02 commit 4279123
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ post('mandrill-webhook', ['as' => 'mandrill.webhook', 'uses' => 'MandrillControl

3) Make sure you add your webhook in Mandrill to point to your route. You can do this here: https://mandrillapp.com/settings/webhooks

## Webhook Authentication
Publish the configuration via
## (Optional) Webhook Authentication
If you would like to increase the security of the webhooks. Add the *MandrillWebhookServiceProvider* provider to the providers array in config/app.php

```php
'providers' => [
...
EventHomes\Api\Webhooks\MandrillWebhookServiceProvider::class,
],
```

Next, publish the configuration via
```php
php artisan vendor:publish --provider="EventHomes\Api\Webhooks\MandrillWebhookServiceProvider"
```
Expand Down
3 changes: 3 additions & 0 deletions src/MandrillWebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public function handleWebHook(Request $request)

foreach ($events as $event) {
$eventName = isset($event['event']) ? $event['event'] : 'undefined';
if($eventName == 'undefined' && isset($event['type'])){
$eventName = $event['type'];
}
$method = 'handle' . studly_case(str_replace('.', '_', $eventName));

if (method_exists($this, $method)) {
Expand Down

0 comments on commit 4279123

Please sign in to comment.