Closed lachlanhickey closed 4 years ago
Can you post your code please?
return WebhookMessage::create() ->data(['body' => 'hello']) ->query( [ 'param1' => 'hello', ]) ->header('Content-Type', 'application/json') ->header('Authorization', 'Basic '. $authorization);
Sorry i think I'm having a bad day. It will be blatantly obvious to you, no doubt.
Looks correct to me, can you post the stack trace for the error please?
Does this help?
`[2019-12-30 09:23:20] local.ERROR: Call to undefined method NotificationChannels\Webhook\WebhookMessage::query() {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to undefined method NotificationChannels\Webhook\WebhookMessage::query() at /var/www/ss-ops/dev/app/Notifications/SendSMS.php:78) [stacktrace]
"} `
That method definitely exists: https://github.com/laravel-notification-channels/webhook/blob/master/src/WebhookMessage.php#L67
What version are you running?
Using the latest version
I've double checked and it's working correctly for me. Is it possible you need to restart your queue to use the latest version? What PHP version are you running?
The queue is restarted with every code change. PHP 7.3, running on nginx.
Any more thoughts on what might cause this? I cannot figure this error out. hmm
I can't see any other possible issue that you are running an old version of the package.
https://github.com/laravel-notification-channels/webhook/blob/master/tests/MessageTest.php#L37-L41
There's even a test for the method.
Can you post your composer.lock
Ok, I see that my version is wrong.
However, I'm pulling from composer require laravel-notification-channels/webhook
How do composer packages get their latest version from packageist?
I have updated composer, dumped autoload, deleted the composer.lock, checked the version of the package in composer.json and the files are still the old version in my vendor folder.
Deleted the folder, redownloaded, still the same.
What PHP and laravel version are you running?
What's in your composer.json?
{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "repositories":[ {"type":"composer","url":"https://repo.koolreport.com"} ], "require": { "php": "^7.1.3", "anlutro/bulk-sms": "^2.1", "awobaz/compoships": "1.*", "aws/aws-sdk-php": "^3.128", "barryvdh/laravel-snappy": "^0.4.3", "codedge/laravel-fpdf": "^1.5", "creativeorange/gravatar": "~1.0", "doctrine/dbal": "^2.7", "fideloper/proxy": "^4.0", "gladcodes/keygen": "^1.1", "h4cc/wkhtmltoimage-amd64": "0.12.x", "h4cc/wkhtmltopdf-amd64": "0.12.x", "itsjavi/bootstrap-colorpicker": "^3.0", "koolreport/blade": "*", "koolreport/export": "*", "koolreport/pro": "*", "kyslik/laravel-filterable": "2.0.*", "laravel-notification-channels/pushover": "^2.1", "laravel-notification-channels/webhook": "^1.3", "laravel/framework": "5.8.*", "laravel/passport": "^6.0", "laravel/tinker": "^1.0", "maatwebsite/excel": "^3.1", "matthewbdaly/laravel-azure-storage": "^1.3", "nexmo/client": "^2.0", "nikkanetiya/laravel-color-palette": "^1.3", "predis/predis": "^1.1", "spatie/laravel-permission": "^2.12", "spatie/laravel-webhook-client": "^2.3", "tzsk/sms": "^3.0", "yajra/laravel-datatables-oracle": "9.*" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.2", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true }
I just ran composer require laravel-notification-channels/webhook
in another application, same issue. Wrong version..
So I have no idea what I'm doing wrong right now.
Oh my, I understand the issue now. It's actually my fault, the new release wasn't tagged :(
Sorry, tag will be live shortly, not sure how I missed that!
Phew, so I'm not mad, then? hehe
Appreciate your support.
Tagged as 1.4.0, will be live on packagist shortly. Sorry again 🙈 https://github.com/laravel-notification-channels/webhook/tree/1.4.0
Any reason why I can't use query params?
Symfony\\Component\\Debug\\Exception\\FatalThrowableError: Call to undefined method NotificationChannels\\Webhook\\WebhookMessage::query()