Download the PHP package dominservice/laravel_chat without Composer
On this page you can find all versions of the php package dominservice/laravel_chat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dominservice/laravel_chat
More information about dominservice/laravel_chat
Files in dominservice/laravel_chat
Package laravel_chat
Short Description users messaging system
License MIT
Homepage https://github.com/dominservice/laravel_chat
Informations about the package laravel_chat
Laravel Chat
This package will allow you to add a full user messaging system into your Laravel application.
Notice
This package is for Laravel 5.6 | 5.7 | 5.8 | 6. | 7. | 8.*
Installation
Or place manually in composer.json:
Run:
Add the service provider to config/app.php
Publish config:
Migrate
Usage
Get User Conversations:
This will return you a "Illuminate\Support\Collection" of "Dominservice\LaravelChat\Entities\Conversation" objects. And foreach Conversation there, you will have the last message of the conversation, and the users of the conversation. Example:
Get User specific conversation:
This will return you a "Dominservice\LaravelChat\Entities\Conversation" object. On the object you could get all messages, all users, conv_id, and more, simply browse the object itself. Example:
Get the conversation id of a conversation between two users:
Simply gives you an id of the conversation between two users, this was created for redirecting to the conversation page when user tries to send a message to another user, so if there is no id returned that means that those users has no conversation yet, so we could create one.
Add a new message to conversation:
Simply add a message to an exiting conversation, content is the message text.
Create a new conversation:
Creates a new conversation with the users id's you passed in the array.
Get all users in conversation:
returns an array of user id in the conversation.
Delete conversation:
"Deletes" the conversation from a specifc user view.
Check if user is in conversation:
True or False if user is in conversation.
Get number of unread messages for specific user:
return an integer of number of unread messages for specific user.
Mark all messages as "read" for specifc user in conversation:
Example
Helpers
Get all conversations for user. If userId
is null
then set current user id.
Create conversations between selected users, in array must be id
list.
Delete conversations for user. If userId
is null
then set current user id.
Check is user in conversations. If userId
is null
then set current user id.
Add message to conversations. If userId
is null
then set current user id.
Add message to conversations between two users, it also create conversation if not exist, or add to exist. If senderId
is null
then set current user id.
Get count unread messages for user. If userId
is null
then set current user id.
Get conversation between two users. If senderId
is null
then set current user id.
Get conversation messages. If userId
is null
then set current user id.
Mark messages. If userId
is null
then set current user id.