PHP code example of mvdnbrk / laravel-postmark-webhooks

1. Go to this page and download the library: Download mvdnbrk/laravel-postmark-webhooks 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/ */

    

mvdnbrk / laravel-postmark-webhooks example snippets


/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    PostmarkWebhookCalled::class => [
        YourListener::class,
    ],
];



namespace App\Listeners;

use Mvdnbrk\PostmarkWebhooks\Events\PostmarkWebhookCalled;

class YourListener
{
    /**
     * Handle the event.
     *
     * @param  \Mvdnbrk\PostmarkWebhooks\Events\PostmarkWebhookCalled  $event
     * @return void
     */
    public function handle(PostmarkWebhookCalled $event)
    {
        // Do your work here.

        // You can access the payload here with: $event->payload.
        // The email address, message ID and record type are also available:
        // $event->email
        // $event->messageId
        // $event->recordType
    }
}


/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    'webhook.postmark: spam_complaint' => [
        YourSpamComplaintListener::class,
    ],
];

'log' => [
    ...
    'except' => [
        'open',
        ...
    ],
],

'events' => [
    'spam_complaint' => App\Events\SpamComplaint,
    ...
],
 bash
php artisan migrate
bash
php artisan vendor:publish --provider="Mvdnbrk\PostmarkWebhooks\PostmarkWebhooksServiceProvider" --tag="config"