PHP code example of andresilva / filament-webhook-server

1. Go to this page and download the library: Download andresilva/filament-webhook-server 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/ */

    

andresilva / filament-webhook-server example snippets


return [
    /*
     *  Models that you want to be part of the webhooks options
     */
    'models' => [
        \App\Models\User::class,
    ],
    /*
     */
    'polling' => '10s'
];



use Marjose123\FilamentWebhookServer\WebhookPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
               WebhookPlugin::make() // <- Add this
        ]);  
       
}

bash
php artisan vendor:publish --tag="filament-webhook-server-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-webhook-server-config"

public function toWebhookPayload()
{
    return [
        'customAttribute' => $this->yourAttribute
    ];
}