spatie / laravel-webhook-client

Receive webhooks in Laravel apps
https://freek.dev/1383-sending-and-receiving-webhooks-in-laravel-apps
MIT License
985 stars 146 forks source link

"Not a valid process webhook job class" #177

Closed 6ichem closed 1 year ago

6ichem commented 1 year ago

Hi, I've copied 1:1 code from the documentation to handle a webhook but it's throwing this error: "`App\\Jobs\\ProcessWebhookJob` is not a valid process webhook job class. A valid class should implement `Spatie\\WebhookClient\\Jobs\\ProcessWebhookJob`.

Handler implementation

<?php

namespace App\Jobs;

use Spatie\WebhookClient\Jobs\ProcessWebhookJob as SpatieProcessWebhookJob;

class ProcessWebhookJob extends SpatieProcessWebhookJob
{
    public function handle()
    {
        logger('works');
        // $this->webhookCall // contains an instance of `WebhookCall`

        // perform the work here
    }
}

Config implementation:

/*
    * The class name of the job that will process the webhook request.
    *
    * This should be set to a class that extends \Spatie\WebhookClient\Jobs\ProcessWebhookJob.
    */
'process_webhook_job' => App\Jobs\ProcessWebhookJob::class