-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
array_merge(): Expected parameter 2 to be an array #288
Comments
I have the same problem seems to me that the code in the function that calls for trigger function, at least on laravel 8 is not sending the right parameters: this is the line 112: in ...Illuminate/Broadcasting..../PusherBroadcaster.php $response = $this->pusher->trigger( and this is the function in pusher-php-server/Pusher.php line 473: public function trigger($channels, $event, $data, $params = array(), $already_encoded = false) I changed to: public function trigger($channels, $event, $params = array(), $already_encoded = false, $data=null) and the problem was solved for me at least for now, I'm very new on this. additionally the PusherBroadcaster.php it's expecting a response to be an array and an object is sent back so I change the line # 542 in the Pusher.php as well from : return $result; to return $response; hope it helps at least for now until the problem is fixed |
Thank you for sharing your work-around!! |
I had same problem, after my workaround, I solved it by restoring the pusher to the original, and creating a new workaround: there is three problems for me when calling from laravel 8 when calling trigger function of Pusher.php Here is the line 112: in ...Illuminate/Broadcasting..../PusherBroadcaster.php I'm avoiding to change the laravel PusherBroadcaster, so I changed the Pusher.php in order to correct that problems: My workaround is like this: 1- Line 499 of Pusher.php 2-Line 518 of Pusher.php 3- Line 542 of Pusher.php using that it works for me, and Im getting messages on the browser: |
Guys, Are you using laravel 8.29.0? I've reported this a while back: laravel/framework#36339 and this was fixed in 8.29.0: laravel/framework#36344 Please note that if you're using laravel-websockets you need to use at least 1.10 (beyondcode/laravel-websockets#698) |
Thanks @Koozza. This should be resolved in v8.29.0 of Laravel. I'll close this issue now. |
I fixed it with this |
Why is this still closed? can we close this when it works in Laravel again? |
If you got this error it means, your pusher package is not compatible with the current Laravel version. To avoid this error just install the right package then it will work fine. I got the same error and resolved by installing the right compatible package. |
Whenever I try to dispatch an event I get this error
Can anyone help me out?
This is my MessageSent() class code
The text was updated successfully, but these errors were encountered: