Laravel AWS SNS Events
7.x
7.x
  • โšกIntroduction
  • ๐ŸŽ‰Support
  • Getting Started
    • โฌ†๏ธUpgrading from 6.x
    • ๐Ÿš€Installation
    • ๐Ÿ“กConfiguring Events
    • ๐ŸงชTesting your implementation
  • Customization
    • ๐Ÿ“ฆCustom Payload
    • ๐ŸคฟCustom Event Classes
    • ๐Ÿ”—Custom Method Hooks
  • AWS Webhooks
    • โšกIntroduction
    • ๐Ÿš€Installation
    • ๐Ÿ™ŒShowcase
    • ๐Ÿ–ฅ๏ธSupported AWS Services
      • ๐ŸšจCloudWatch Alerts
      • ๐Ÿ“งSimple Email Service (SES)
      • ๐ŸŒ‰EventBridge Events
    • ๐ŸงชTesting your implementation
Powered by GitBook
On this page

Was this helpful?

  1. Customization

Custom Method Hooks

In case you don't want to handle the SNS events using Laravel Events or simply you can't handle them via Laravel Events, you can handle the methods sent on notification or subscription via controller methods:

use Rennokki\LaravelSnsEvents\Http\Controllers\SnsController;

class CustomSnsController extends SnsController
{
    /**
     * Handle logic at the controller level on notification.
     *
     * @param  array  $snsMessage
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function onNotification(array $snsMessage, Request $request): void
    {
        //
    }

    /**
     * Handle logic at the controller level on subscription.
     *
     * @param  array  $snsMessage
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function onSubscriptionConfirmation(array $snsMessage, Request $request): void
    {
        //
    }
}
PreviousCustom Event ClassesNextIntroduction

Last updated 3 years ago

Was this helpful?

๐Ÿ”—