Created
June 10, 2017 18:53
-
-
Save styks1987/4bd74b1f35983c4c33c630d503194c45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pusher = new \Pusher( | |
env('PUSHER_AUTH_KEY', null), | |
env('PUSHER_APP_SECRET', null), | |
env('PUSHER_APP_ID', null), | |
$options | |
); | |
$data['message'] = 'Order ' . $order->id . ' was updated'; | |
$pusher->trigger('order', 'updated', $data); | |
?> | |
The javascript | |
<script> | |
const pusher = new Pusher(pusherAuthKey, { | |
encrypted: true | |
}); | |
const channel = pusher.subscribe('order'); | |
channel.bind('updated', this.getOrders) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment