I'm having issues doing event broadcasting using Pusher from within an Eloquent event listener. My event are being fired and sent out from Laravel controller perfectly. However, it seems that the broadcasts are not actually reaching pusher when I trigger them from within my Eloquent event listener.
// trigger event
$pusher = \App::make('pusher');
$channel = $record->username;
$pusher->trigger($channel, 'status-changed', $record);
Turned out to be a date synchronization issue.
My local server is an Ubuntu machine while my live server is running on CentOS. Running the following commands solved the problem:
sudo ntpdate ntp.ubuntu.com
sudo ntpdate pool.ntp.org