diff --git a/CHANGELOG.md b/CHANGELOG.md index d00ae65..4f60076 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog + +## 1.1.0 +- Bumped Support for Laravel 8 +- Added ability to add any further options to `SNSClient` config (i.e. to override `endpoint`) +- *Breaking Change*: Inherited the name to the `Subject` field of an SNS Message. This either comes from `broadcastAs()` or the Class name ([see here](https://laravel.com/docs/8.x/broadcasting#broadcast-name) for more info). The last change is potentially breaking if one did not want the subject set. + ## 1.0.1 * Allow using IAM Role diff --git a/composer.json b/composer.json index 9351d9b..8635850 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { - "name": "maxgaurav/laravel-sns-broadcaster", + "name": "alexw23/laravel-sns-broadcaster", "description": "Sns Messages as queues using extended laravel sqs driver.", "type": "library", "license": "MIT", - "homepage": "https://github.com/maxgaurav/laravel-sns-broadcaster", + "homepage": "https://github.com/alexw23/laravel-sns-broadcaster", "authors": [ { - "name": "Max Gaurav", - "email": "max.gaurav@ithands.net" + "name": "Alex Whiteside", + "email": "alexwhiteside@ignitedlabs.com.au" } ], "keywords": [ @@ -17,13 +17,13 @@ "aws" ], "require": { - "php": "^7.2", + "php": ">=7.4 <8.4", "ext-json": "*", - "illuminate/broadcasting": "6.* || 7.*", - "illuminate/support": "6.* || 7.*", - "illuminate/contracts": "6.* || 7.*", - "illuminate/config": "6.* || 7.*", - "aws/aws-sdk-php": "^3.62" + "illuminate/broadcasting": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "illuminate/contracts": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "illuminate/config": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "aws/aws-sdk-php": "^3.305" }, "config": { "sort-packages": true, diff --git a/src/LaravelSnsBroadcastProvider.php b/src/LaravelSnsBroadcastProvider.php index 7ee17c6..58e43a4 100644 --- a/src/LaravelSnsBroadcastProvider.php +++ b/src/LaravelSnsBroadcastProvider.php @@ -41,6 +41,10 @@ public function getSnsClientConfig($config) ); } + if(!empty($config['options']) && is_array($config['options'])) { + $snsConfig = array_merge($snsConfig, $config['options']); + } + return $snsConfig; } } diff --git a/src/SnsBroadcaster.php b/src/SnsBroadcaster.php index 98c3884..bd12ab4 100644 --- a/src/SnsBroadcaster.php +++ b/src/SnsBroadcaster.php @@ -44,6 +44,7 @@ public function broadcast(array $channels, $event, array $payload = []) { $this->snsClient->publish([ 'TopicArn' => $this->topicName($channels), + 'Subject' => $event, 'Message' => json_encode(Arr::except($payload, 'socket')), ]); }