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: about 6 hours 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T16:28:48.000Z (12 months ago)
- Last Synced: 2024-09-18T09:27:21.899Z (9 days 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
[![Total Downloads](https://img.shields.io/packagist/dt/itsnubix/aws-sns-sms-channel.svg?style=flat-square)](https://packagist.org/packages/itsnubix/aws-sns-sms-channel)
[![Build Status](https://travis-ci.org/itsnubix/aws-sns-sms-channel.svg?branch=master)](https://travis-ci.org/itsnubix/aws-sns-sms-channel/)
[![Latest Stable Version](https://poser.pugx.org/itsnubix/aws-sns-sms-channel/v/stable.svg)](https://packagist.org/packages/itsnubix/aws-sns-sms-channel)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](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)