N
N
NikSIk312019-08-09 12:57:07
Laravel
NikSIk31, 2019-08-09 12:57:07

Laravel php chat db storage?

To create chats between site users (personal, 1 on 1, so to speak), as far as I understand, this requires a separate table like chatrooms where id_1 id_2 users are stored, and another table with messages where in general all messages from all chats, chatroom_id, message, sender_id , something like this ..
Can you tell me if this is how it is done ??

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2019-08-09
@Sanasol

chatrooms where id_1 id_2 are stored

why? If nothing is expected except 1 by 1, then everything can be stored in one table, from and to fields.

A
Anton R., 2019-08-09
@anton_reut

My solution, if you're interested: The architecture of the database tables for the Private Messages functionality, so logical?

K
Konstantin Eliseev, 2019-08-10
@K0r5hun

You can also take a ready-made package and look at the code or modify it for yourself if necessary
https://github.com/cmgmyr/laravel-messenger

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question