samedi 31 mars 2018

Laravel Broadcast putting details on Logs

I am trying to implement Broadcast with pusher . Everything works fine when I tested it on the local host . But as soon as I uploaded the files on Server , broadcast started to put the data on the Logs instead of pushing it to pusher.

Here is my Event

class MessageReceive implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;
    public $message, $sender , $id;

    public function __construct(Messenger $data)
    {
        $this->message = $data->message;
        $this->sender = $data->people_id;
        $this->id = $data->user_id;
    }

    public function broadcastOn()
    {
        return new Channel('message.' . $this->sender);
    }

    public function broadcastAs()
    {
        return 'MessageReceive';
    }

    public function broadcastWith()
    {
        return [
            'id' => $this->id,
            'sender' => $this->sender,
            'message' => $this->message,
            'time' => now(),
        ];
    }

}

Here is what I get on my log file..

[2018-03-31 18:34:35] local.INFO: Broadcasting [MessageReceive] on channels [message.1526560620] with payload:
{
    "id": "1",
    "sender": "1526560620",
    "message": "hey buddy",
    "time": {
        "date": "2018-03-31 18:34:35.000000",
        "timezone_type": 3,
        "timezone": "UTC"
    },
    "socket": null
} 

I did tried to restart the queue , but it doesn't seems to work



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2E9lClP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire