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

CookieMonster's avatar

Suggestion on how to build real time chat?

I want to add a real time messaging chat system to my forum and had a research and looked about package called chatify, while it looks really cool but there's still many issues with it.

I figured I need to use Pusher (it's not free per say) but I would like to know what is the best way to do it using laravel ?

Suggest me some good packages or your expert views on them.

0 likes
6 replies
Tippin's avatar

Alternative to pusher would be to install your own socket.io, or packages such as:

Chat packages or references:

Messenger I am working on: https://github.com/RTippin/messenger

You can basically choose to go the livewire approach if you do not need instant realtime and do not mind polling, or use any websocket implementation and get your feet wet in the https://laravel.com/docs/8.x/broadcasting

Realtime or not, I prefer my base database setup of threads participants and messages tables, as it makes it rather easy to store what you need and relate messages to a thread whether private or group, while being able to broadcast to any participants within a thread without worrying about who a single message is being sent to (I like to think of a message as alerting all participants in a thread, not directly to a single user)

Tippin's avatar

@nickywan123

Thanks, so the messenger that you're working is open source right?

Yes, it is open source. Fork it, use it, do as you please with it.

Would you recommend it as stable for the current version it's released?

It is stable in that it works and I have it being used on multiple projects, and have over 1k passing tests. However, it is pre-release, so I may add new features or version breaking changes rather often until I reach v1.

Of course you do not have to use my or anyone's package, but simply use them as references / guides to build your own!

GeorgeBro's avatar

I found a great resource that (admittedly) I have not tried yet. It is something I hope to incorporate into my project very soon, but got distracted by some rabbit holes along the way. When I viewed this Youtube tutorial it appeared to be exactly what I need... and appears to be what you are looking for. If you explore this and test it before I do, please let me know how it works.

Websockets in Laravel

This is an 8 part series that has the essentials of what I suspect we're looking to implement.

CookieMonster's avatar

Thanks for the link. yea many of the commenters above suggested to use web sockets as well as an alternative to pusher (although I think websockets uses pusher as well).

Please or to participate in this conversation.