PHPackages                             sevenspan/laravel-chat - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sevenspan/laravel-chat

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sevenspan/laravel-chat
======================

The Laravel Chat package simplifies one-to-one and group chat integration, facilitates document sharing within chats, manages read and unread message counts, and supports document uploads to both local and AWS S3 storage

1.5.2(5mo ago)182395MITPHPPHP ^8.1 || ^8.2 || ^8.3

Since Oct 18Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/7span/laravel-chat)[ Packagist](https://packagist.org/packages/sevenspan/laravel-chat)[ Docs](https://github.com/7span/chat)[ RSS](/packages/sevenspan-laravel-chat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (19)Used By (0)

Laravel Chat
============

[](#laravel-chat)

The Laravel Chat package simplifies one-to-one chat integration facilitates document sharing within chats, manages read and unread message counts, and supports document uploads to both local and AWS S3 storage

Index
-----

[](#index)

- [Prerequisites](#prerequisites)
- [Features](#features)
- [Installation](#installation)
- [Configurations](#configurations)
- [Credits](#credits)
- [Contributing](#contributing)
- [License](#license)

**Prerequisites**
-----------------

[](#prerequisites)

Before you get started, make sure you have the following prerequisites installed:

- PHP &gt;= 8.1 (Support 8.2)
- Composer &gt;= 2.0
- Laravel &gt;= 8.1 (Supports L10 and L11)
- AWS API credentials (Optional)
- Pusher

**Features**
------------

[](#features)

- One-to-One Chat Integration
- Document Sharing within Chats
- Read and Unread Message Count Management
- Document Upload Support for Local Storage
- Document Upload Support for AWS S3 Storage
- Message body encryption and decryption

**Installation**
----------------

[](#installation)

To install this package, use Composer:

```
composer require sevenspan/laravel-chat
```

**Configurations**
------------------

[](#configurations)

To configure the package, publish the migration file with the following command:

```
php artisan vendor:publish --provider="SevenSpan\Chat\Providers\ChatServiceProvider"
```

This command will publish the configuration file chat.php to your project's config directories, respectively.

If you have cached configurations locally, clear the config cache using one of these commands:

```
php artisan optimize:clear

```

After publishing the migration and configuring, create the required tables for this package by running:

```
php artisan migrate

```

To configure message body encryption add these key on `.env` file.

```
CHAT_ENCRYPT_MESSAGE=true #boolean

```

Usage
-----

[](#usage)

Once you have installed the package, you can start using its features in your Laravel application. Here's a brief overview of how to use some of the main features:

### 1. List Channels

[](#1-list-channels)

Use the `list` method to get all channels.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 12; (Required)
// $channelIds = [1, 2, 3]; (Optional)
// $perPage = 10; (Optional)

Channel::list($userId, $channelIds, $perPage);
```

### 2. Detail of Channel

[](#2-detail-of-channel)

Use the `detail` method to get the detail of channel.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 12; (Required)
// $channelId = 10; (Required)

Channel::detail($userId, $channelId);
```

### 3. Create Channel

[](#3-create-channel)

Use the `create` method to create the new channel.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 12; (Required)
// $receiverId = 10; (Required)
// $channelName = "Goverment project" (Required)

Channel::create($userId, $receiverId, $channelName);
```

### 4. Update Channel

[](#4-update-channel)

Use the `update` method to update the channel details.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 12; (Required)
// $receiverId = 10; (Required)
// $channelName = "Goverment project" (Required)

Channel::update($userId, $receiverId, $channelName);
```

### 5. Delete Channel

[](#5-delete-channel)

Use the `delete` method to delete the channel.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 12; (Required)
// $channelId = 10; (Required)

Channel::delete($userId, $channelId);
```

### 6. Clear Channel History

[](#6-clear-channel-history)

Use the `clearMessage` method to clear the chat history.

```
use SevenSpan\Chat\Facades\Channel;

// $userId = 1; (Required)
// $channelId = 1 (Required)

Channel::clearMessage($userId, $channelId);
```

### 7. List Message

[](#7-list-message)

Use the `list` method to get all messages of the channel.

```
use SevenSpan\Chat\Facades\Message;

// $userId = 1; (Required)
// $channelId = 1 (Required)
// $perPage = 10; (Optional)

Message::list($userId, $channelId, $perPage);
```

### 8. Send Message

[](#8-send-message)

Use the `send` method to send a message.

```
use SevenSpan\Chat\Facades\Message;

// $userId = 1; (Required)
// $channelId = 1 (Required)
// $data = [
//    'body' => 'TEXT_MESSAGE',
//    'file' => Image Or Document
// ]; (Required)

Message::send($userId, $channelId, $data);
```

Note

In the $data param either body or file is required.

### 9. Get Files Message

[](#9-get-files-message)

Use the `getFiles` method to document of the channel.

```
use SevenSpan\Chat\Facades\Message;

// $userId = 1; (Required)
// $channelId = 1 (Required)
// $type = 'image' (Default: image)
// $perPage = 10; (Optional)

Message::getFiles($userId, $channelId, $type, $perPage);
```

Note

$type param supported value is `image` or `zip`.

### 10. Delete Message

[](#10-delete-message)

Use the `delete` method to delete the message.

```
use SevenSpan\Chat\Facades\Message;

// $userId = 1; (Required)
// $channelId = 1 (Required)
// $messageId = 10; (Required)

Message::delete($userId, $channelId, $messageId);
```

### 11. Read Message

[](#11-read-message)

Use the `read` method to read the message of a channel.

```
use SevenSpan\Chat\Facades\Message;

// $userId = 1; (Required)
// $channelId = 1 (Required)
// $messageId = 10; (Required)

Message::read($userId, $channelId, $messageId);
```

Note

The messages that have a lesser value than $messageId will be read automatically.

### 12. User List

[](#12-user-list)

Use the `list` method to get a list of users and also search for the name of the user.

```
use SevenSpan\Chat\Facades\User;

// $userId = 1; (Required)
// $name = "John Doe" (Optional)
// $perPage = 10; (Optional)

User::list($userId, $name, $perPage);
```

Credits
-------

[](#credits)

- [Harshil Patanvadiya](https://github.com/harshil-patanvadiya)
- [Kajal Pandya](https://github.com/kajal98)
- [Hemratna Bhimani](https://github.com/hemratna)

Contributing
------------

[](#contributing)

If you encounter any issues or would like to contribute to this package, we welcome contributions from the community to improve and enhance this package. If you'd like to contribute, please follow our contribution guidelines:

- Fork this repository.
- Clone the forked repository to your local machine.
- Create a new branch for your feature or bug fix: git checkout -b feature/your-feature-name
- Make your changes and commit them: git commit -m 'Add new feature'
- Push your changes to your fork: git push origin feature/your-feature-name
- Create a pull request to the original repository.

License
-------

[](#license)

This package is open-source software licensed under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance71

Regular maintenance activity

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 52.2% 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 ~64 days

Recently: every ~163 days

Total

13

Last Release

162d ago

PHP version history (3 changes)1.0.0PHP ^8.1

1.5.0PHP ^8.1 || ^8.2

1.5.2PHP ^8.1 || ^8.2 || ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/08bf8e5911bd55b6328d8e1a32c786000dc7023bc741cbad255a2625ed91a75b?d=identicon)[hemratna](/maintainers/hemratna)

---

Top Contributors

[![harshil-7span](https://avatars.githubusercontent.com/u/86794709?v=4)](https://github.com/harshil-7span "harshil-7span (35 commits)")[![kajal-7span](https://avatars.githubusercontent.com/u/107455736?v=4)](https://github.com/kajal-7span "kajal-7span (20 commits)")[![akshay-m-7span](https://avatars.githubusercontent.com/u/155456074?v=4)](https://github.com/akshay-m-7span "akshay-m-7span (7 commits)")[![yash-c-7span](https://avatars.githubusercontent.com/u/101334825?v=4)](https://github.com/yash-c-7span "yash-c-7span (3 commits)")[![damini-7span](https://avatars.githubusercontent.com/u/101109560?v=4)](https://github.com/damini-7span "damini-7span (1 commits)")[![labomatik](https://avatars.githubusercontent.com/u/179987?v=4)](https://github.com/labomatik "labomatik (1 commits)")

---

Tags

composerlaravelchatLaravel Chatchat systemchat packagechat-applicationmessaging-package

### Embed Badge

![Health badge](/badges/sevenspan-laravel-chat/health.svg)

```
[![Health](https://phpackages.com/badges/sevenspan-laravel-chat/health.svg)](https://phpackages.com/packages/sevenspan-laravel-chat)
```

###  Alternatives

[musonza/chat

Chat Package for Laravel

1.2k253.4k1](/packages/musonza-chat)[lexxyungcarter/chatmessenger

Simple one-to-one/group chat messaging tool for Laravel 5, 6, 7, 8, 9 &amp; 10 with Pusher Integration

10724.1k](/packages/lexxyungcarter-chatmessenger)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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