Closed ali4zimi closed 2 years ago
@azimi-ali @musonza This is only the migration, can we also include the methods to add the JSON data upon sending the message like here: https://github.com/musonza/chat/#send-a-message-of-custom-type so it becomes something like:
$message = Chat::message('http://example.com/img')
->data([
'new_data' => 'my new JSON data'
])
->type('image')
->from($model)
->to($conversation)
->send();
At first, I apologize that I mistakenly closed the branch.
But then, I appreciate your comment because it is a good idea to have a function to add more details to the data. So feel free to add your code or if you want me to add it comment back.
@azimi-ali Yes please if you can add it would be much appreciated.
@azimi-ali thanks for the additions. Do you mind adding a unit test for the changes?
@musonza If you don't mind, please wait a few hours. Some changes are missing. I will push it today.
@azimi-ali no worries. Take your time and let me know whenever ready
Dear @musonza, and @dhi2, Accept my apologies. The old project has been deleted accidentally, and I couldn't push my changes to the old PR anymore. Therefore, I have opened a new pull request, and I want to close this PR.
A column ('data') to store details about each message was added. For instance, if our message type is an image, we can add the image link, or if it is a link we can store the link and attachment details in it. The conversation table already has this column, I think there is a need for this in the message table too.