mitchdav / sns-laravel Goto Github PK
View Code? Open in Web Editor NEWA library to enable sending and receiving broadcasts to and from SNS topics in Laravel and Lumen.
License: MIT License
A library to enable sending and receiving broadcasts to and from SNS topics in Laravel and Lumen.
License: MIT License
I followed the steps given in wiki. But throwing below error -
[2019-07-22 16:26:42] lumen.ERROR: InvalidArgumentException: Broadcaster [sns] is not defined. in /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/broadcasting/BroadcastManager.php:183
Stack trace:
#0 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/broadcasting/BroadcastManager.php(162): Illuminate\Broadcasting\BroadcastManager->resolve('sns')
#1 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/broadcasting/BroadcastManager.php(151): Illuminate\Broadcasting\BroadcastManager->get('sns')
#2 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/broadcasting/BroadcastManager.php(138): Illuminate\Broadcasting\BroadcastManager->driver('sns')
#3 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/broadcasting/BroadcastServiceProvider.php(30): Illuminate\Broadcasting\BroadcastManager->connection()
#4 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/container/Container.php(749): Illuminate\Broadcasting\BroadcastServiceProvider->Illuminate\Broadcasting\{closure}(Object(Laravel\Lumen\Application), Array)
#5 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/container/Container.php(631): Illuminate\Container\Container->build(Object(Closure))
#6 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/container/Container.php(586): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array)
#7 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/laravel/lumen-framework/src/Application.php(230): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#8 /home/iss/Documents/Workspace/sg/Lumen-API/vendor/illuminate/container/BoundMethod.php(156): Laravel\Lumen\Application->make('Illuminate\\Cont...')
Is there anything missing?
Btw thanks for library :)
Hey Mitch,
Just came across this issue when trying to run php artisan config:cache
. From what I can tell it is sns-laravel
causing the issue here.
Here is a relevant issue from Laravel Github that hopefully shines some light: laravel/framework#9625
Cheers,
Derek
Hey Mitch!
Any plans to add Laravel 5.6 support now that it has been released?
Cheers,
Derek
I've installed as per the given instruction, but it's giving below error while running php artisan sns:create my-new-topic
n SNS.php line 78:
The topic must exist in the topics configuration.
I tried making my own SNS broadcaster for Lumen, ran into IoC problems. Found this package, installed it, and it seemingly has the same challenge:
Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Illuminate\Broadcasting\BrodcastManager
The way Lumen registers service providers and instantiates singletons is different, and apparently bad for BrodcastManager.
Any chance you have insight into how to make this package Lumen compatible?
Hey,
we'd really love to use your library but we're currently on Laravel 5.7 and are planning to switch to 5.8 soon. Can we use the 5.6 version with 5.7 and 5.8 too?
Thanks
Pelle
The library would benefit from a formal testsuite that would test the interoperation with the live SNS system.
Unfortunately, I haven't been able to find a way to test whether a webhook route is called or not, so I've posted this question on Stack Overflow.
If you know how to detect this, please comment here or on the SO question and I will get this added to the library.
In a fresh install, likely don't have any AWS credentials set. As such config:publish blows up:
php artisan vendor:publish --provider="Mitchdav\SNS\Provider"
In ClientResolver.php line 371:
Missing required client configuration options:
region: (string)
A "region" configuration value is required for the "sns" service
(e.g., "us-west-2"). A list of available public regions and endpoints can be
found at http://docs.aws.amazon.com/general/latest/gr/rande.html.
Adding AWS_REGION to .env resolves this issue.
Assuming this isn't blowing up in the AWS library and can be resolved within sns-laravel, I will submit a PR.
The AWS SDK uses AWS_ACCESS_KEY_ID
instead of AWS_ACCESS_KEY
and AWS_SECRET_ACCESS_KEY
instead of AWS_SECRET_KEY
.
If configured like written in the wiki, any command throws this:
Aws\Exception\CredentialsException : Error retrieving credentials from the instance profile metadata server. (cURL error 28: Connection timed out after 1005 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html))
With renaming the variables in the .env
file it works fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.