Download the PHP package laravel-notification-channels/aws-sns without Composer

On this page you can find all versions of the php package laravel-notification-channels/aws-sns. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel

Latest Version on Packagist Build Status StyleCI Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using AWS SNS with Laravel framework. Since Laravel already ships with SES email support, this package focuses on sending only SMS notifications for now. More advanced features like support for topics could be added in the future.

Contents

Installation

You can install the package via composer:

Setting up the AWS SNS service

Add your AWS key ID, secret and default region to your config/services.php:

Usage

Now you can use the channel in your via() method inside the notification:

In order to let your Notification know which phone are you sending to, the channel will look for the phone, phone_number or full_phone attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForSns method to your Notifiable model.

Available SnsMessage methods

More information about the SMS Attributes can be found on the AWS SNS Docs. It's important to know that the attributes set on the message will override the default ones configured in your AWS account.

Common Problems

Exception Handling

Exceptions are not thrown by the package in order to give other channels a chance to work properly. Instead, a Illuminate\Notifications\Events\NotificationFailed event is dispatched. For debugging purposes you may listen to this event in the boot method of EventServiceProvider.php.

Lack of Permissions on AWS

By default Laravel Vapor creates the role laravel-vapor-role in AWS, which does not have permissions to send SMS via SNS. This results in SMS being sent successfully in local environments but will not be sent on a Vapor environment. Your messages might also not be sent if you are using an ID/Secret pair for a particular IAM user that can't interact with SNS.

In either case, you need to make sure the credentials you are using (either your role or user) are allowed to interact with the AWS services your application needs. On IAM (Identity and Access Management), you may attach the AWS Managed policy AmazonSNSFullAccess or a more granular custom policy to the role/user your application is using.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Security

If you discover any security related issues, please email [email protected] 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.


All versions of aws-sns with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
aws/aws-sdk-php Version ^3.69.11
guzzlehttp/guzzle Version ^6.2.1 || ^7.0
illuminate/notifications Version ^9.0|^10.0 || ^11.0
illuminate/support Version ^9.0|^10.0 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laravel-notification-channels/aws-sns contains the following files

Loading the files please wait ....