laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.84k stars 645 forks source link

Extend Slack Notification to work with Slack Apps for Laravel 11 support #1481

Closed travisricks closed 1 month ago

travisricks commented 1 month ago

Reference: https://github.com/laravel/framework/discussions/51879

Laravel 11 supports Slack notifications with not only webhook urls but also using a Slack app, but this repository is configured only for webhook urls. Added a new condition to check if the supplied destination is a webhook url or channel id and return the appropriate response.

Screenshot-003236-2024-07-25at22 18 01@2x

driesvints commented 1 month ago

We'll need to fix the static analysis tests before proceeding.

travisricks commented 1 month ago

@driesvints I (think) I fixed the php stan issues by using // @phpstan-ignore-line on line 114. I only did this because the file was already using that previously for a different type hint issue.

If I understand the issue correctly it's because the type-hinted class only exists in Laravel 11. I tried adding a safety check for that by adding class_exists() checks in the if statement.

But please let me know if this is not the correct solution or if other changes are necessary.

siarheipashkevich commented 1 month ago

@travisricks what about updating the documentation for this ability?