lab123/aws-sns
Larablocks Analysis
lab123/aws-sns works with Laravel 10 to 13 (latest release v2.1.0, Nov 12, 2026).
Laravel 5 in earlier releases.
Recommendation checks
PromisingPromising: maintained and up to date, meets 2 of 4 checks; not yet widely used.
- Works with Laravel 13, the current version
- Released in the last 12 months (Nov 12, 2026)
- 50 downloads a month (needs 10,000)
- 31 GitHub stars (needs 100)
State
Maintained- Last stable release: Nov 12, 2026.
- 2 releases in the last 12 months.
- First released: Sep 13, 2017.
- Monthly downloads: 50, up 4900% from six months ago.
- 2 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require lab123/aws-sns |
|
| Latest Version: | v2.1.0 |
| PHP: | ^8.1 |
| Laravel: | 10 – 13 |
| Older releases: | 5 |
| License: | MIT |
| Last Updated: | Nov 27, 2026 |
| Links: | GitHub · Packagist |
Amazon SNS Notifications Channel for Laravel
Send notifications through Amazon SNS from Laravel or Lumen: SMS to a phone number or a message to a topic.
Requirements
- PHP ^8.1
- Lumen 10 or 11, or Laravel 10, 11, 12 or 13 (
illuminate/*^10.0, ^11.0, ^12.60 or ^13.10) aws/aws-sdk-php^3
Verified in real applications: Lumen 10.0 and 11.1, Laravel 10.50, 11.57, 12.70 and 13.37, sending SMS and topic messages against a local SNS endpoint.
Lumen 5 to 9 and Laravel 5 to 9 apps cannot use this release; stay on lab123/aws-sns:^1.0 (the pre-2.0 code).
Installation
composer require lab123/aws-sns
Laravel 10 and 11, Lumen 10 and 11: security advisory
Composer blocks illuminate/mail 10 and 11 (a dependency of illuminate/notifications) because of advisory PKSA-zwc5-qtrz-zm1n. Laravel 10 and 11 are end of life and have no fix; only illuminate/* ^12.60 and ^13.10 are patched. If you stay on 10 or 11 you accept that risk, and can install with:
composer config policy.advisories.ignore-id --json '["PKSA-zwc5-qtrz-zm1n"]'
composer require lab123/aws-sns
Register the provider
Laravel: the service provider is auto-discovered.
Lumen (bootstrap/app.php), together with a notification setup such as lab123/lumen-notification:
$app->register(\Lab123\AwsSns\AwsSnsServiceProvider::class);
AwsSnsLumenServiceProvider from earlier versions still works as an alias.
Configure the SNS credentials
Add an sns entry to config/services.php:
'sns' => [
'key' => env('SNS_KEY'),
'secret' => env('SNS_SECRET'),
'region' => env('SNS_REGION', 'us-east-1'),
],
SNS_KEY=YOUR_KEY
SNS_SECRET=YOUR_SECRET
SNS_REGION=YOUR_REGION
Default SMS attributes (optional)
Publish the config and set the defaults that are applied through SetSMSAttributes before each SMS:
php artisan vendor:publish --provider="Lab123\AwsSns\AwsSnsServiceProvider" --tag=config
// config/aws-sns.php
return [
'sms' => [
'monthlySpendLimit' => env('SNS_SMS_MONTHLY_LIMIT'),
'deliveryStatusIAMRole' => env('SNS_SMS_DELIVERY_STATUS_IAM_ROLE'),
'deliveryStatusSuccessSamplingRate' => env('SNS_SMS_DELIVERY_STATUS'),
'defaultSenderID' => env('SNS_SMS_SENDER'),
'defaultSMSType' => env('SNS_SMS_TYPE'),
'usageReportS3Bucket' => env('SNS_SMS_REPORT_S3'),
],
];
Empty values are skipped.
Usage
Sending SMS
use Lab123\AwsSns\Channels\AwsSnsSmsChannel;
use Lab123\AwsSns\Messages\AwsSnsMessage;
class Welcome extends Notification
{
public function via(object $notifiable): array
{
return [AwsSnsSmsChannel::class];
}
public function toAwsSnsSms(object $notifiable): AwsSnsMessage
{
return (new AwsSnsMessage())->message('Message Here')->phoneNumber('+5511999999999');
}
}
Omit ->phoneNumber() and add a route method on the notifiable instead:
public function routeNotificationForAwsSnsSms(): string
{
return $this->phone_number;
}
To send under a different Sender ID per message (for example when sending on behalf of several clients), use ->senderId(). It overrides the account-wide defaultSenderID for that message only:
return (new AwsSnsMessage('Message Here'))->phoneNumber('+5511999999999')->senderId('ACME');
Sender IDs are not supported in every country (for example the United States) and some countries require pre-registration; see the AWS SMS country list.
Numbers use the international E.164 format, e.g. +5511999999999.
Sending to a topic
use Lab123\AwsSns\Channels\AwsSnsTopicChannel;
public function via(object $notifiable): array
{
return [AwsSnsTopicChannel::class];
}
public function toAwsSnsTopic(object $notifiable): AwsSnsMessage
{
return (new AwsSnsMessage())
->message('Message Here')
->topicArn('arn:aws:sns:us-east-1:000000000000:name-topic');
}
Or provide the ARN from the notifiable:
public function routeNotificationForAwsSnsTopic(): string
{
return $this->topicArn;
}
Available message methods
topicArn($topicArn): topic ARN from Amazon SNSphoneNumber($phoneNumber): phone number to send the notification tomessage($message): message content
A notification is skipped when there is no destination or no message, and a CouldNotSendNotification exception is thrown when SNS answers with a status other than 200.
Changelog
See CHANGELOG.
Testing
composer test
Security
If you discover any security related issues, please email jean.pierre@lab123.com.br instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Alternatives to lab123/aws-sns
A simple Laravel service provider which adds a new queue connector to handle SNS...
Easily send Brevo transactional email and sms with Laravel notifier.
Laravel client for the uBill SMS API: sends, personalized batches, delivery repo...
Laravel package to handle AWS SNS notifications with seamless integration and ev...
A Laravel broadcasting driver and queue driver that broadcasts and listens to pu...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v2.1.0 | ^8.1 | ^10.0| | MIT | |
| v2.0.0 | ^8.1 | ^10.0| | MIT | |
| v1.0.0 | >=5.6.4 | ^5.1| | MIT |