Skip to content

Instantly share code, notes, and snippets.

@Ghostscypher
Last active September 7, 2021 13:46
Show Gist options
  • Save Ghostscypher/4731ce8dc884228afec7ae008c8dabd4 to your computer and use it in GitHub Desktop.
Save Ghostscypher/4731ce8dc884228afec7ae008c8dabd4 to your computer and use it in GitHub Desktop.
<script>
const public_channel = '{{config('app.name')}}.Public';
Echo.channel(public_channel)
.listen('OrderShipmentStatusUpdated', (data) => {
console.log(data)
});
</script>
@logged_in
<script>
const private_channel = '{{config('app.name')}}.{{auth()->user()->id}}';
Echo.private(private_channel)
.notification((notification) => {
console.log(notification);
});
</script>
@endlogged_in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment