PHPackages                             coliving/talk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. coliving/talk

ActiveLibrary[Queues &amp; Workers](/categories/queues)

coliving/talk
=============

This is fork from Nahid/Talk to change it works with new Laravel 8.x, 9.x, 10.x, 11.x and 12.x. Talk is a Laravel 8, 9, 10, 11 &amp; 12 based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

1.6.3(1y ago)030.9k↓43.5%1CC0-1.0PHPPHP &gt;=8.0

Since Mar 2Pushed 1y ago3 watchersCompare

[ Source](https://github.com/dungnh/coliving-talk)[ Packagist](https://packagist.org/packages/coliving/talk)[ Docs](https://github.com/dungnh/coliving-talk)[ RSS](/packages/coliving-talk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

Coliving-Talk
=============

[](#coliving-talk)

This is fork from Nahid/Talk to change it works with new Laravel 8, 9, 10, 11, 12. Talk is a Laravel 8, 9, 10, 11, 12 based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

Laravel-Talk
============

[](#laravel-talk)

[![Awesome Laravel](https://camo.githubusercontent.com/8deb0d78e81ca47c3c3533bd8de23d75fa7a6f4f3e8fb067f246c42e62a8d06a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f417765736f6d652d4c61726176656c2d627269676874677265656e2e737667)](https://github.com/nahid/talk)[![GitHub license](https://camo.githubusercontent.com/c5bc1f6d1cca4590445b39db475f89fec3c345801181d50cccc0440140f6411a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4343302d626c75652e737667)](https://raw.githubusercontent.com/nahid/talk/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/41dcf71a5200979c86bd63ef8c0fbe01e3e80463efada37bce5b01663dd6be0a/68747470733a2f2f7472617669732d63692e6f72672f6e616869642f74616c6b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nahid/talk)

Talk is a Laravel 8, 9, 10, 11, 12 based user conversation (inbox) system with realtime messaging. You can easily integrate this package with any Laravel based project. It helps you to develop a messaging system in just few minutes. Here is a project screenshot that was developed by Talk.

Talk v2.1.0 supports realtime messaging. Learn more about [Talk Live Messaging](https://github.com/nahid/talk#realtime-messaging)

#### Feedback

[](#feedback)

If you already used Talk, please share your experience with us. It will make the project better.

[Give us your feedback](https://github.com/nahid/talk/issues/43)

#### Built with Talk

[](#built-with-talk)

If you are using Talk in your project please share your project URL or project name with us. It will inspire other people to use Talk.

See which project was [Built with Talk](https://github.com/nahid/talk/issues/42)

Caution
-------

[](#caution)

> Do not migrate 1.1.7 from its higher version directly. Please try our [sample project](https://github.com/nahid/talk-example) first and then apply it on your project.

[![Talk-Example Screenshot](https://camo.githubusercontent.com/28c0d4c3690fad32b3ee72ac159d74288d5e983b046eda5fe99076d164b5166b/687474703a2f2f692e696d6775722e636f6d2f75513773676d492e706e67 "Talk-Example Project")](https://camo.githubusercontent.com/28c0d4c3690fad32b3ee72ac159d74288d5e983b046eda5fe99076d164b5166b/687474703a2f2f692e696d6775722e636f6d2f75513773676d492e706e67)

You may try [Talk-Example](https://github.com/nahid/talk-example) project.

Or you can try live [Demo](http://portal.inilabs.net/baseapp/v1.0/admin/message/inbox) by using this credentials

```
username: admin
password: admin

```

So let's start your tour :)

### Features

[](#features)

- Head to head messaging
- Realtime messaging
- Creating new conversation
- Message threads with latest one
- View conversations by user id or conversation id
- Support pagination in threads and messages
- Delete(soft delete) message from both end. Sender and receiver can delete their message from their end.
- Permanent delete message
- Mark message as seen
- Only participant can view or access there message or message threads

### Installation

[](#installation)

Talk is a Laravel package so you can install it via composer. Run this command in your terminal from your project directory.

```
composer require nahid/talk

```

Wait for a while, Composer will automatically install Talk in your project.

### Configuration

[](#configuration)

When the download is complete, you have to call this package service in `config/app.php` config file. To do that, add this line in `app.php` in `providers` section

```
Nahid\Talk\TalkServiceProvider::class,
```

To use facade you have to add this line in `app.php` in `aliases` array

```
'Talk'      => Nahid\Talk\Facades\Talk::class,
```

Now run this command in your terminal to publish this package resources

```
php artisan vendor:publish --provider="Nahid\Talk\TalkServiceProvider"

```

After running this command, all necessary file will be included in your project. This package has two default migrations. So you have to run migrate command like this. (But make sure your database configuration is configured correctly.)

```
php artisan migrate
```

Okay, now you need to configure your user model for Talk. Go to `config/talk.php` and config it.

```
return [
    'user' => [
        'model' => 'App\User'
    ],
    'broadcast' => [
        'enable' => false,
        'app_name' => 'your-app-name',
        'pusher' => [
            'app_id'        => '',
            'app_key'       => '',
            'app_secret'    => '',
            'options' => [
                 'cluster' => 'ap1',
                 'encrypted' => true
            ]
        ]
    ]
];
```

### Usage

[](#usage)

Its very easy to use. If you want to set authenticate user id globally then you have to set a middleware first. Go to `app/Http/Kernel.php` and set it in `$routeMiddleware` array

```
'talk'  =>  \Nahid\Talk\Middleware\TalkMiddleware::class,
```

And now you can use it from anywhere with middleware. Suppose you have a Controller and you want to set authenticate user id globally, then write this in controller constructor

```
$this->middleware('talk');
```

But instead of setting id globally, you can use these procedure from any method in controller.

```
Talk::setAuthUserId(auth()->user()->id);
```

Now you may use any method that you need. But if you want to pass authentic id instantly, this method may help you.

```
Talk::user(auth()->user()->id)->anyMethodHere();
```

Please see the API Doc.

### API List

[](#api-list)

- [setAuthUserId](https://github.com/nahid/talk#setauthuserid)
- [user](https://github.com/nahid/talk#user)
- [isConversationExists](https://github.com/nahid/talk#isconversationexists)
- [isAuthenticUser](https://github.com/nahid/talk#isauthenticuser)
- [sendMessage](https://github.com/nahid/talk#sendmessage)
- [sendMessageByUserId](https://github.com/nahid/talk#sendmessagebyuserid)
- [getInbox](https://github.com/nahid/talk#getinbox)
- [getInboxAll](https://github.com/nahid/talk#getinboxAll)
- [threads](https://github.com/nahid/talk#threads)
- [threadsAll](https://github.com/nahid/talk#threadsall)
- [getConversationsById](https://github.com/nahid/talk#getconversationbyid)
- [getConversationsAllById](https://github.com/nahid/talk#getconversationallbyid)
- [getConversationsByUserId](https://github.com/nahid/talk#getconversationbyuserid)
- [getConversationsAllByUserId](https://github.com/nahid/talk#getconversationallbyuserid)
- [getMessages](https://github.com/nahid/talk#getmessages)
- [getMessagesByUserId](https://github.com/nahid/talk#getmessagesbyuserid)
- [getMessagesAll](https://github.com/nahid/talk#getmessagesall)
- [getMessagesAllByUserId](https://github.com/nahid/talk#getmessagesallbyuserid)
- [readMessage](https://github.com/nahid/talk#readmessage)
- [makeSeen](https://github.com/nahid/talk#makeseen)
- [getReceiverInfo](https://github.com/nahid/talk#getreceiverinfo)
- [deleteMessage](https://github.com/nahid/talk#deletemessage)
- [deleteForever](https://github.com/nahid/talk#deleteforever)
- [deleteConversations](https://github.com/nahid/talk#deleteconversations)

### setAuthUserId

[](#setauthuserid)

`setAuthUserId` method sets the currently loggedin user id, which you pass through parameter. If you pass `null` or `empty` value then it returns false.

**Syntax**

```
void setAuthUserId($userid)
```

**Example**

Constructor of a Controller is the best place to write this method.

```
function __construct()
{
    Talk::setAuthUserId(auth()->user()->id);
}
```

When you pass logged in user ID, Talk will know who is currently authenticated for this system. So Talk retrieve all information based on this user.

### user

[](#user)

You may use this method instead of `setAuthUserId()` method. When you have to instantly access users conversations then you may use it. **Syntax**

```
object user($id)
```

**Example**When you haven't set authenticated user id globally, then you just use this method directly with others method.

```
$inboxes = Talk::user(auth()->user()->id)->threads();
return view('messages.threads', compact('inboxes'));
```

### isConversationExists

[](#isconversationexists)

This method checks currently logged in user and if given user is already in conversation

**Syntax**

```
int|false isConversationExists($userid)
```

**Example**

```
if ($conversationId = Talk::isConversationExists($userId)) {
    Talk::sendMessage($conversationId, $message);
}
```

### isAuthenticUser

[](#isauthenticuser)

isAuthenticUser checks if the given user exists in given conversation.

**Syntax**

```
boolean isAuthenticUser($conversationId, $userId)
```

**Example**

```
if (Talk::isAuthenticUser($conversationId, $userId)) {
    Talk::sendMessage($conversationId, $message);
}
```

### sendMessage

[](#sendmessage)

You can send messages via conversation id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return `false`

**Syntax**

```
object|false sendMessage($conversationId, $message)
```

**Example**

```
    $message = Talk::sendMessage($conversationId, $message);
    if ($message) {
        return response()->json(['status'=>'success', 'data'=>$message], 200);
   }
```

### sendMessageByUserId

[](#sendmessagebyuserid)

You can send message via receiver id by using this method. If the message is successfully sent, it will return objects of Message model otherwise, it will return `false`

**Syntax**

```
object|false sendMessageByUserId($userId, $message)
```

### getInbox

[](#getinbox)

If you want to get all the inboxes except soft deleted message , this method may help you. This method gets all the inboxes via previously assigned authenticated user id. It returns collections of message thread with latest message.

**Syntax**

```
array getInbox([$order = 'desc'[,$offset = 0[, $take = 20]]])
```

**Example**

```
// controller method
$inboxes = Talk::getInbox();
return view('message.threads', compact('inboxes');
```

```

    @foreach($inboxes as $inbox)

            {{$inbox->withUser->name}}
            {{$inbox->thread->message}}
            {{$inbox->thread->humans_time}}

    @endforeach

```

### getInboxAll

[](#getinboxall)

Its similar as `getInbox()` method. If you want to get all the inboxes with soft deleted messages, this method may help you. This method gets all the inboxes via given user id.

**Syntax**

```
object getInboxAll([$order = 'desc'[,$offset = 0[, $take = 20]]])
```

### threads

[](#threads)

This method is an alias of `getInbox()` method.

**Syntax**

```
array threads([$order = 'desc'[,$offset = 0[, $take = 20]]])
```

### threadsAll

[](#threadsall)

This method is an alias of `getInboxAll()` method.

**Syntax**

```
array threadsAll([$order = 'desc'[,$offset = 0[, $take = 20]]])
```

### getConversationsById

[](#getconversationsbyid)

When you want to get all the conversations using your desired conversation id, you can try this method. This method returns all the conversations(except soft deleted) with `sender` and `withUser` objects

**Syntax**

```
array getConversationsById($conversationId[, $offset = 0[, $take = 20]])
```

**Example**

```
// controller method
$conversations = Talk::getConversationsById($conversationId);
$messages = $conversations->messages;
$withUser = $conversations->withUser;

return view('messages.conversations', compact('messages', 'withUser'));
```

This method returns two objects `messages` and `withUser`. `messages` object contains messages collection and `withUser` object contains participant User collections.

Let's see how to use it with your views

```

    Chat with {{$withUser->name}}
    @foreach($messages as $msg)

        {{$msg->sender->name}}
        {{$msg->humans_time}}

            {{$msg->message}}

    @endforeach

```

### getConversationsAllById

[](#getconversationsallbyid)

This method is similar as `getConversationsById()`. The only difference between this method is its return all messages with soft deleted items.

**Syntax**

```
array getConversationsAllById($conversationId[, $offset = 0[, $take = 20]])
```

### getConversationsByUserId

[](#getconversationsbyuserid)

When you want to get all the conversations using your desired receiver id, you can try this method. This method returns all the conversations(except soft deleted message) with user's objects

**Syntax**

```
object getConversationsByUserId($receiverId [, $offset = 0[, $take = 20]])
```

### getConversationsAllByUserId

[](#getconversationsallbyuserid)

This method is similar as `getConversationsByUserId()`. The only difference between this method is it returns all messages with soft deleted items.

**Syntax**

```
array getConversationsAllByUserId($receiverId[, $offset = 0[, $take = 20]])
```

### getMessages

[](#getmessages)

This is a alias of `getConversationsById()` method.

**Syntax**

```
array messages($conversationId[, $offset = 0[, $take = 20]])
```

### getMessagesAll

[](#getmessagesall)

This is a alias of `getConversationsAllById()` method.

**Syntax**

```
array messagesAll($conversationId[, $offset = 0[, $take = 20]])
```

### getMessagesByUserId

[](#getmessagesbyuserid)

This is a alias of `getConversationsByUserId()` method.

**Syntax**

```
array messagesByUserId($receiverId[, $offset = 0[, $take = 20]])
```

### getMessagesAllByUserId

[](#getmessagesallbyuserid)

This is a alias of `getConversationsAllByUserId()` method.

**Syntax**

```
array messagesAllByUserId($receiverId[, $offset = 0[, $take = 20]])
```

### readMessage

[](#readmessage)

If you want to read a single message then you may use it. This message is return a single message object by message id.

**Syntax**

```
array readMessage($messageId)
```

### getReceiverInfo

[](#getreceiverinfo)

This method returns all the information about message receiver.

> This method is deprecated from version 2.0.0 and it will be removed from version 2.0.2

**Syntax**

```
object getReceiverInfo($conversationId)
```

### makeSeen

[](#makeseen)

If you want to set a message as seen you can use this method.

**Syntax**

```
boolean makeSeen($messageId)
```

### deleteMessage

[](#deletemessage)

When you want to delete a specific message from a conversation, you have to use this method. This method soft delete message for both user-end individually.

**Syntax**

```
boolean deleteMessage($messageId)
```

### deleteForever

[](#deleteforever)

If you want to hard delete or permanently delete a specific message then you have to use this method

**Syntax**

```
boolean deleteForever($messageId)
```

### deleteConversations

[](#deleteconversations)

This method is used to permanently delete all conversations

**Syntax**

```
boolean deleteConversations($conversationId)
```

Realtime Messaging
------------------

[](#realtime-messaging)

Talk also support realtime messaging thats called Talk-Live. Talk use pusher for realtime message. So first you have to configure pusher. Go to `app/talk.php` again and configure.

```
return [
    'user' => [
        'model' => 'App\User'
    ],
    'broadcast' => [
        'enable' => false,
        'app_name' => 'your-app-name',
        'pusher' => [
            'app_id'        => '',
            'app_key'       => '',
            'app_secret'    => ''
        ]
    ]
];
```

in this new version broadcast section was added with talk config. Here broadcast is disabled by default. If you want to enable live(realtime) messaging then you have to enable it first. Then add pusher credentials. Thats it. Everytime when you send message then talk will automatically fire two event, one for specific user and second for specific conversation. So you may listen or subscribe one or both as per your wish. Finally you have to subscribe these events by using `talk_live()` helper function. Go to where you want to subscribe to work with message data follow this code.

```

    var msgshow = function(data) {
        // write what you want with this data

        console.log(data);
    }

{!! talk_live(['user'=>["id"=>auth()->user()->id, 'callback'=>['msgshow']]]) !!}

```

`talk_live()` supports one parameters as array. The first parameter is for channel name which you want to subscribe. You have not know which channel was broadcast. Talk broadcast two channel by default. One for user and second for conversation. If you want to subscribe channel for currently loggedin user then you have to pass

logedin user id in 'user' key. `['user'=>['id'=>auth()->user()->id, 'callback'=[]]` or you want to subscribe for conversation id you have pass conversation id as 'conversation' key. `['conversation'=>['id'=>$conversationID, 'callback'=>[]]`. You may pass both if you want.

You can pass a callback for working with pusher recieved data. For both `user` and `conversation` section support callbacks as array. So you can pass multiple callback as array value that was shown in previous example.

You can watch [Talk-Live-Demo](https://youtu.be/bN3s_LbObnQ)

### Try Demo Project

[](#try-demo-project)

[Talk-Example](https://github.com/nahid/talk-example)

#### Special Thanks To

[](#special-thanks-to)

[Shipu Ahamed](https://github.com/shipu)

Thanks :)

Support for this project
------------------------

[](#support-for-this-project)

Hey dude! Help me out for a couple of 🍻!

[![Beerpay](https://camo.githubusercontent.com/ede508807c4f2bd8062740b24d92d1d13fe051693df8c0aab8c4668766205602/68747470733a2f2f626565727061792e696f2f6e616869642f74616c6b2f62616467652e7376673f7374796c653d626565722d737175617265)](https://beerpay.io/nahid/talk) [![Beerpay](https://camo.githubusercontent.com/296d27f97856e45c0f4ca4fb37772da873cbe3ea92157133cd1d4a2c7566a813/68747470733a2f2f626565727061792e696f2f6e616869642f74616c6b2f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/nahid/talk?focus=wish)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance44

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 90.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~233 days

Recently: every ~177 days

Total

12

Last Release

435d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.1.3

1.6.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/724121?v=4)[coliving](/maintainers/coliving)[@coliving](https://github.com/coliving)

---

Top Contributors

[![dungnh](https://avatars.githubusercontent.com/u/1852709?v=4)](https://github.com/dungnh "dungnh (28 commits)")[![ngoctiennet](https://avatars.githubusercontent.com/u/181210354?v=4)](https://github.com/ngoctiennet "ngoctiennet (3 commits)")

---

Tags

messagephplaravelreal-timerealtimechatinboxconversations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/coliving-talk/health.svg)

```
[![Health](https://phpackages.com/badges/coliving-talk/health.svg)](https://phpackages.com/packages/coliving-talk)
```

###  Alternatives

[nahid/talk

Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

1.6k58.1k4](/packages/nahid-talk)[baklysystems/laravel-chat-messenger

Laravel chat package

121.8k](/packages/baklysystems-laravel-chat-messenger)[munafio/chatify

A package for Laravel PHP Framework to add a complete real-time chat system.

2.4k441.9k2](/packages/munafio-chatify)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.6k9.4M48](/packages/laravel-reverb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
