Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #326
    jacob_smith
    Participant

    I’ve been stuck for hours fixing a livewire listener that won’t respond to events broadcaster by pusher.

    Livewire Component:

    public function getListeners() {

    return [

    “echo-private:orders. {$this -> orderID}, .OrderShipped” => ‘orderShipped’,

    ];

    public function orderShipped() {
    dd(‘Update user that the order has been shipped’)
    }

    My problem is that that orderShipped function won’t fire although the event is properly broadcasted on the laravel-websockets console.

    I’ve searched a lot of this and it looks like a recurring problem.

    #327

    A lot of TALL developers struggle on this. You can try emitting the event in the Javascript l

    window.Echo.private(‘orders.orderID’)
    .listen(‘EventName’, (e) => {
    //emit the Event payload from JS to Livewire
    Livewire.emit(‘livewirelistername’, e.orders.orderID)
    });

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.