PHP code example of bridit / laravel-sns

1. Go to this page and download the library: Download bridit/laravel-sns library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bridit / laravel-sns example snippets


protected $except = [
  ...
  '/aws/sns', // Or other route that you set on broadcasting.php
];

use Rennokki\LaravelSnsEvents\Events\SnsNotification;
use Rennokki\LaravelSnsEvents\Events\SnsSubscriptionConfirmation;

...

protected $listen = [
    ...
    SnsNotification::class => [
        // add your listeners here for SNS events
    ],
    SnsSubscriptionConfirmation::class => [
        // add your listeners here in case you want to listen to subscription confirmation
    ],
]

class MyListener
{
    ...

    public function handle($event)
    {
        // $event->payload is an array
    }
}