Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SUPAD's avatar

Listening to NodeJS events from Laravel ?

Hello everyone,

I'm creating a quiz game for which i need nodeJS to handle the different screens involved.

It works great but now i need to save the player answer.

I could use AJAX from the client's player, access MySQL from NodeJS but it seems ugly to me.

I would like to trigger a Laravel event from NodeJS, in a similar way that Laravel broadcast events via Redis.

I would have NodeJS emitting in redis and Laravel beeing triggered by this.

Is it possible ?

In the video tutorial (https://laracasts.com/series/real-time-laravel-with-socket-io) it's not mentionned, not even to say it's not possible.

Thanks

0 likes
2 replies
martinbean's avatar

@SUPAD It sounds like you need to build a simple API in Laravel to handle the saving of data, that you would call inside your Node.js application, rather than using “events”.

SUPAD's avatar

Thanks Martin for your answer, that's what i thought, too bad, i was very excited to the idea of having an all-event environnement from the client to the Laravel... :(

Please or to participate in this conversation.