PHP Classes

File: src/views/pusherjs.blade.php

Recommend this page to a friend!
  Classes of Nahid Bin Azhar  >  Laravel Talk  >  src/views/pusherjs.blade.php  >  Download  
File: src/views/pusherjs.blade.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Laravel Talk
Manage a multiple user conversation system
Author: By
Last change: fix pagination system issue
fix pusher connection issue for cluster
Date: 4 years ago
Size: 931 bytes
 

Contents

Class file image Download
<script src="https://js.pusher.com/3.2/pusher.min.js"></script>
<script>

    // Enable pusher logging - don't include this in production
    Pusher.logToConsole = true;
    var pusher = new Pusher('{{$talk__appKey}}', {!! $talk__options !!});

    @if(!empty($talk__userChannel['name']))
    var userChannel = pusher.subscribe('{{$talk__userChannel['name']}}');
    userChannel.bind('talk-send-message', function(data) {
        @foreach($talk__userChannel['callback'] as $callback)
        {!! $callback . '(data);' !!}
        @endforeach
    });

    @endif

    @if(!empty($talk__conversationChannel['name']))
    var conversationChannel = pusher.subscribe('{{$talk__conversationChannel['name']}}');
    conversationChannel.bind('talk-send-message', function(data) {
        @foreach($talk__conversationChannel['callback'] as $callback)
        {!! $callback . '(data);' !!}
        @endforeach
    });
    @endif
</script>

For more information send a message to info at phpclasses dot org.