Download the PHP package dominservice/conversations without Composer
On this page you can find all versions of the php package dominservice/conversations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dominservice/conversations
More information about dominservice/conversations
Files in dominservice/conversations
Package conversations
Short Description This package will allow you to add a full user messaging system into your Laravel application.
License MIT
Homepage https://github.com/dominservice/conversations
Informations about the package conversations
Conversations
This package will allow you to add a full user messaging system into your Laravel application.
Notice
This package is for Laravel
Version | Compatibility |
---|---|
1.* | 5.6 --> 9.* |
2.* | 8. --> 10. |
IMPORTANT
This package is a continuation of the dominservice/laravel_chat package, due to significant structural changes I decided to create a separate repository. If you have a previous version, you can uninstall it while retaining the database contents, the new package includes a migration moving the data to the new structure. Remember to make a backup before performing this operation!
Installation
Or place manually in composer.json:
Run:
Add the service provider to config/app.php
Publish config:
Migrate
REMEMBER
Configure the package in the config/conversations.php file
Usage
Create New Conversation:
Or short with helper
if you get conversation object "Dominservice\Conversations\Entities\Conversation" with all relations and users, else method return onlu conversation ID
Add message to Conversation if exists or create:
Or short with helper
Add message to Conversation:
Or short with helper
Get Conversation ID between users:
Or short with helper
Check exists user in Conversation:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Get count all unreaded messages:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Get count unreaded messages in specific conversation:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Delete Conversation:
This method tes status to DELETED for all messages in conversation for selected user. If all messages for all users has status DELETED remove permanently all values for conversation.
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Get all Conversations for specyfic user:
This will return you a "Illuminate\Support\Collection" of "Dominservice\Conversations\Entities\Conversation" objects. And foreach Conversation there, you will have the last message of the conversation, and the users of the conversation. Example:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id, and helper set array with users adn conversations.
Get messages of conversation:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Get unread messages of conversation:
Or short with helper
On helper if userId is null, userId = \Auth::user()->id
Set status for message:
Mark messages. If userId
is null
then set current user id.