spatie/laravel-webhook-client

App\Http\Controllers\Spatie\WebhookClient\Http\Controllers\WebhookController was not found

kartman5 opened this issue · 5 comments

Hi,

After upgrading this package to the 3.1.0 package not working properly.

This throw WebhookController was not found error.

How can I resolve this issue?

Thanks.

That namespace is wrong. Use\Spatie\WebhookClient\Http\Controllers\WebhookController

I know it's a namespace error, but this error comes after updating in laravel 9.

image

Above error message comes when doing a composer update and all other PHP artisan commands.

The error is coming because of this line

return Route::post($url, WebhookController::class)->name("webhook-client-{$name}");

Package should define controller like

return Route::post($url, '\Spatie\WebhookClient\Http\Controllers\WebhookController')->name("webhook-client-{$name}");

otherwise laravel will unable to find the controller when the macro is inside a group like

Route::group(['namespace'=> 'MyPath\Folder'], function() {
    Route::webhook("my-webhhok");
});

@freekmurze Would you accept a PR ?

Similar PR was send spatie/laravel-stripe-webhooks#100

@ankurk91 Yup, send a PR 👍