Yes, it can be done with this stack - I've done it myself, and I wrote a blog post about how to do so. The Laravel documentation also goes into some detail about this. Our app wasn't using Ionic, but otherwise the situation was basically the same.
The gist of it is as follows:
- Messages are submitted to the REST API via a POST request as usual
- When a message is submitted, the controller fires a
NewMessage
event
- This event is set as broadcastable, and uses the Redis driver (you may prefer to use Pusher, but I used Redis and Socket.io)
- A separate Node.js script listens for the
NewMessage
event, and when it fires, emits the message to all attached clients (or if chat is meant to be private, only the appropriate clients)
- On receiving the message using
socket.io-client
, the appropriate action is taken, eg the message is inserted into the DOM
The only addition you need to make to your stack is Node.js and Redis. The biggest issue I had was with configuring Nginx, but that was partly because I was using SSL.
Hope this makes sense. Let me know if you need any more information on how to accomplish this.