Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
introwit committed Nov 19, 2019
1 parent 863ae25 commit 4753fa0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
All the notable changes to the Laravel Aws Sns package are documented in this file:

## v1.0.1 (20-11-2019)
- Added `awsSnsWebhooks` route helper

## v1.0.0 (18-11-2019)
- Initial release
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ composer require joggapp/laravel-aws-sns

- The package will automatically register itself.

- You can assign the AwsSnsController to any of your desired routes. The AwsSnsController is a single action controller, so all you have to assign is just the controller class to the route. Eg:
- You then need to pass the route to `awsSnsWebhooks`:

```php
use JoggApp\AwsSns\Controllers\AwsSnsController;

...

Route::post('webhooks/aws/sns', AwsSnsController::class);
Route::awsSnsWebhooks('route-you-added-in-aws-sns-topic-subscription-console');
```

- The package emits 2 events: `SnsTopicSubscriptionConfirmed` & `SnsMessageReceived`.
Expand Down
5 changes: 4 additions & 1 deletion src/AwsSnsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

namespace JoggApp\AwsSns;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

class AwsSnsServiceProvider extends ServiceProvider
{
public function boot()
{
//
Route::macro('awsSnsWebhooks', function ($url) {
return Route::post($url, '\JoggApp\AwsSns\Controllers\AwsSnsController');
});
}

public function register()
Expand Down

0 comments on commit 4753fa0

Please sign in to comment.