spatie / laravel-webhook-client

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

Attribute [webhooks] does not exist. #179

Closed SH1R3F closed 1 year ago

SH1R3F commented 1 year ago

I'm trying to build a package uses this package to manage webhook responses.. I followed the setup in the readme file and everything works fine in local but when switching to console and start writing tests everything fails with this exception Attribute [webhooks] does not exist.

I reproduced the error by building a new empty package that only has the service provider, routes, testing suite and "spatie/laravel-webhook-client": "^3.1".. it fails on first test with same error.

you can find the reproduction package on this repo "https://github.com/SH1R3F/webhook-client-reproduction-test"

dreammonkey commented 1 year ago

Maybe you forgot to run the optimize script, I know I did ;)

# Clear the old boostrap/cache/compiled.php
php artisan clear-compiled

# Recreate boostrap/cache/compiled.php
php artisan optimize
SH1R3F commented 1 year ago

@dreammonkey This poblem happens in scenario of developing a package which doesn't have artisan commands... Also I reproduced the error with an empty new package so I don't think it has something to do with cache!

zgetro commented 1 year ago

@SH1R3F do composer update it will work.

harshuchilzy commented 1 year ago

composer update This happens mostly when the package is not installed correctly. Try to reinstall

freekmurze commented 1 year ago

Closing this as the issue is probably not caused by our code.