itsgoingd / clockwork

Clockwork - php dev tools in your browser - server-side component
https://underground.works/clockwork
MIT License
5.69k stars 321 forks source link

fix: check database/broadcast notification methods before calling #691

Closed ryzr closed 8 months ago

ryzr commented 8 months ago

As per Laravel Docs, the Database Channel can use toDatabase and/or toArray.

In our case, one of our broadcastable notifications had these methods separated, and later had broadcasting removed, leaving behind toDatabase(), but removing toArray(). Although the functionality still works in Laravel, it causes a break in Clockwork.

This PR checks the notification and only calls the first method that exists.

EDIT: also just learned the same of toBroadcast(). Committed a fix for that too.

itsgoingd commented 8 months ago

Nice find, thanks!

JanMisker commented 7 months ago

Any ETA when this will be released?

itsgoingd commented 7 months ago

I'll try to push a new patch release this week.

JanMisker commented 7 months ago

Great thanks, just stumbled on this one in our app.

itsgoingd commented 7 months ago

Released Clockwork 5.2.1 including this fix.