M
M
Max Conner2021-06-16 22:33:55
Laravel
Max Conner, 2021-06-16 22:33:55

Read message status for group chat - read message?

Hello!
I develop chats (group and one-on-one) on Laravel [Pusher], the table structure is as follows:
Table message:
[
id, room_id , sender_id, recipient=nullable, message, created_at, updated_at
]

Table rooms:
[
id, sender_id, model_type, model_id, created_at, updated_at
]

The links themselves are built on Polymorphic Relations
The essence of the question is how to add the ability to give the application the status of a read message in a group chat for each member in the group for each new message (display the read flag), if in the chat from 2 and more members?
Thanks in advance for any help on this matter

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2021-06-16
@cdcdcd

Through the many-to-many table, (message_id, rooms_id, timestamp if necessary)
If there is a record in the table, then it is read. In the api, add a field to the model records, which, accordingly, will have its own value for each.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question