Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Jul 22, 2020
1 parent 5219475 commit 05bbc0a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,41 @@ class CustomSubscriptionConfirmation extends SnsSubscriptionConfirmation
}
```

## Custom Method Hooks

When extending the controller, in case you don't want to handle events, you can handle the methods sent on notification or subscription:

```php
use Rennokki\LaravelSnsEvents\Http\Controllers\SnsController;

class CustomSnsController extends SnsController
{
/**
* Handle logic at the controller level on notification.
*
* @param array $snsMessage
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function onNotification(array $snsMessage, Request $request): void
{
//
}

/**
* Handle logic at the controller level on subscription.
*
* @param array $snsMessage
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function onSubscriptionConfirmation(array $snsMessage, Request $request): void
{
//
}
}
```

## 🐛 Testing

Run the tests with:
Expand Down

0 comments on commit 05bbc0a

Please sign in to comment.