Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsnubix/aws-sns-sms-channel
AWS SNS SMS Notifications Channel for Laravel
https://github.com/itsnubix/aws-sns-sms-channel
aws laravel notifications sms sns
Last synced: 3 months ago
JSON representation
AWS SNS SMS Notifications Channel for Laravel
- Host: GitHub
- URL: https://github.com/itsnubix/aws-sns-sms-channel
- Owner: itsnubix
- License: mit
- Created: 2019-08-30T19:11:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T16:28:48.000Z (over 1 year ago)
- Last Synced: 2024-10-29T23:54:49.469Z (4 months ago)
- Topics: aws, laravel, notifications, sms, sns
- Language: PHP
- Size: 12.7 KB
- Stars: 16
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS SNS SMS Notifications Channel for Laravel
[](https://packagist.org/packages/itsnubix/aws-sns-sms-channel)
[](https://travis-ci.org/itsnubix/aws-sns-sms-channel/)
[](https://packagist.org/packages/itsnubix/aws-sns-sms-channel)
[](LICENSE)## Installation
`composer require itsnubix/aws-sns-sms-channel`
In your `config/services.php` file enter:
```php
'sns' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('SNS_DEFAULT_REGION'),
],
```Notice here that the region is not necessarily your standard `AWS_DEFAULT_REGION` as only certain regions allow SMS messages to be sent from them. [Click here](https://docs.aws.amazon.com/sns/latest/dg/sns-supported-regions-countries.html) for a list of nodes that allow SMS.
Be sure that the user who owns your access key and secret has at least the following policy on AWS IAM:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSendingSMSMessages",
"Effect": "Allow",
"Action": [
"sns:Publish",
"sns:SetSMSAttributes",
"sns:CheckIfPhoneNumberIsOptedOut"
],
"Resource": ["*"]
}
]
}
```Now in your notifications you can do the following:
```php
content('Hello world');
}
}
```Finally you'll need to extend your notifiable class with the following function so it knows how to route SMS notifications.
```php
phone_number;
}
}
```Need more help? [Read the article here](https://medium.com/@kylemilloy/sending-sms-messages-with-laravel-and-amazon-sns-a2183af9d90d)