descom / aws-sns-notification
Package to Laravel to received notification from AWS SNS
Installs: 1 883
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.3
- aws/aws-php-sns-message-validator: ^1.1
- illuminate/config: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/routing: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- descom/dev: ^1.3
- friendsofphp/php-cs-fixer: ^3.75
- larastan/larastan: ^3.0
- orchestra/testbench: ^9.0|^10.0
- phpunit/phpunit: ^10.5|^11.5
This package is auto-updated.
Last update: 2025-04-11 09:11:22 UTC
README
Install
composer require descom/aws-sns-notification
Usage
Create en SNS a subscription HTTPS to a topic
https://localhost:8000/aws/sns/webhook
Capture Events
TopicSubscriptionRequest
use Descom\AwsSnsNotification\Events\TopicSubscriptionRequest; use Illuminate\Support\Facades\Http; class SnsSubscriptionConfirmation { public function handle(TopicSubscriptionRequest $event): void { logger()->info('SNS subscription request', [ 'topic' => $event->topicArn(), ]); // Confirm the subscription by sending a GET request to the SubscribeURL Http::get($event->subscribeUrl()); } }
TopicNotification
use Descom\AwsSnsNotification\Events\TopicNotification; use Illuminate\Support\Facades\Http; class SnsNotificationLogger { public function handle(TopicNotification $event): void { logger()->info('SNS Notification received', [ 'topic' => $event->topicArn(), 'subject' => $event->subject(), 'message' => $event->toJson(), ]); } }