May 30, 2023
0
Level 1
Authenticate Postmark webhook request
Using Laravel 9 I installed a package mvdnbrk/laravel-postmark-webhooks and created PostmarkOutboundWebhook handler.
class PostmarkOutboundWebhook { public function handle(PostmarkWebhookCalled $event): void { } } I also created PostmarkWebhookAuth class to authenticate the request. The credentials I'm gong to store in .env The request come this way: https://:@example.com/api/webhooks/postmark I listen to the request according to the package instructions: class EventServiceProvider extends ServiceProvider {
protected $listen = [
PostmarkWebhookCalled::class => [
PostmarkWebhookAuth::class,
PostmarkOutboundWebhook::class,
],
];
}
Please or to participate in this conversation.