App\Http\Controllers\Spatie\WebhookClient\Http\Controllers\WebhookController was not found
kartman5 opened this issue · 5 comments
kartman5 commented
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.
freekmurze commented
That namespace is wrong. Use\Spatie\WebhookClient\Http\Controllers\WebhookController
kartman5 commented
I know it's a namespace error, but this error comes after updating in laravel 9.
kartman5 commented
ankurk91 commented
The error is coming because of this line
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
freekmurze commented
@ankurk91 Yup, send a PR 👍