'Laravel-echo-server with Socket.io not detecting file changes

I have a very simple application that uses Laravel-echo-server with Socket.io for real-time communication, the application is working, the problem is that when I change the message of the event that is going to be executed, it completely ignores all the changes of the php file, for example I have the following class.

class PublicMessage implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct()
    {
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new Channel('public-message-channel');
    }

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

    public function broadcastWith()
    {   
        return ['message' => "This is a public message"];
    }
}

I subscribe as follows in my front end

window.Echo.channel('public-message-channel').listen('.MessageEvent', (data) => {
    console.log(data);
});

then i trigger the event from a route

Route::get('/chat', function(){
    event(new PublicMessage());
    dd("Public event exceute successful.");
});

and i get

{"message": "This is a public message"}

but if i change the return in broadcastWith function i still get the same response, even restarting the php artisan queue:work the laravel-echo-server and my Xampp server, the only thing that makes it detect the changes is restarting the machine I'm developing on, does anyone have an idea what could be going on?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source