N
N
NikSIk312019-08-10 02:30:50
Database design
NikSIk31, 2019-08-10 02:30:50

Laravel chat with multiple but 1 on 1 (dialogue)?

Recently, I asked about the structure of tables for a simple chat, but did not take into account that I need to do something more complicated. The bottom line is this: this is a partially 1 on 1 chat, only there is a main one, and there are assistants. So the chat is created and then the assistants can write to the main one (each assistant sees only his own dialogue with the main one, and the main one sees all the dialogues and can answer everyone within this chat). That is, on the chat page of the assistant, only the dialogue with the main one is visible, and on the page of the main one - a dialogue with all assistants (who wrote at least one message in the chat)
And the main message is displayed as comments as on the toaster answers (only conversation 1 per 1 and so on for each answer).
How this can be done in terms of structure (tables in the database, logic), I still have little idea of ​​\u200b\u200bsomething.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur, 2019-08-10
@NikSIk31

The structure is the usual
id
user_id
author_id
message
parent_message_id,
or comments and initial messages in different tables, the
rest is already at the logic level, separate messages, show only where you are a user
, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question