AWS SNS HTTP subscription confirmation in PHP

Question:

I am unable to get the confirmation of AWS SNS Http connection in PHP. My application is developed on Laravel 5.1

In AWS I have created a Topic and added a subscription. I have selected endpoint as HTTP and provided the URL http://myurl.com/sns.

My PHP code is below

My route file entry is:

In the browser when I call the URL – http://myurl.com/sns, I get the below error.

I have the following in my composer:

Any help on how to resolve this error and to get confirmation of my subscription?

Answer:

Go to “VerifyCsrfToken” file .
Add

Go to your routes file
add a post route to your method

Edit your method

you will be able to see the the subscription URL in error log or in your out file

Leave a Reply