Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Websockets - Building a chatting system in Laravel

I need to build a conversations (chatting) feature on top of Laravel using Pusher.js. To do this, I would need websockets for the real time chatting.

However, I am not sure at what would be the correct approach towards solving this in a professional manner.

My current planned approach is:

I plan on having multiple Pusher channels. Each Conversation (DB Model) would have a channel_ID column which would be the Pusher channel name, only accessible by Sender / Recipient. Front-end would be a chatting app with multiple conversations shown. Once user clicks on conversation A, it would subscribe to that conversation's channel_ID (Pusher Channel). Once they click on conversation B, it would unsubscribe from channel A and subscribe to channel B.

My issues in the approach is following:

In Laravel, each Broadcast Event (mine is called message) has a function broadcastOn(). However I do not know how would I make this work for say, 10 000 conversations with all having a different channel name? I don't know if this is optimal, it does not seem too good to me.

I've already Googled for a couple of days and looked up many websocket related guides. Many of them go into detail how to create a public chat with everyone receiving the event, but none of them really go into detail how to create an user-to-user secure chatting feature.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!