PHPackages                             ritechoice23/laravel-chat-engine - 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. [Database &amp; ORM](/categories/database)
4. /
5. ritechoice23/laravel-chat-engine

ActiveLibrary[Database &amp; ORM](/categories/database)

ritechoice23/laravel-chat-engine
================================

A UI-agnostic, transport-agnostic, polymorphic chat engine for Laravel with message versioning, reactions, bookmarks, and delivery tracking.

1.0.0(4mo ago)10[2 PRs](https://github.com/ritechoice23/laravel-chat-engine/pulls)MITPHPPHP ^8.2CI passing

Since Jan 6Pushed 1mo agoCompare

[ Source](https://github.com/ritechoice23/laravel-chat-engine)[ Packagist](https://packagist.org/packages/ritechoice23/laravel-chat-engine)[ Docs](https://github.com/ritechoice23/laravel-chat-engine)[ GitHub Sponsors](https://github.com/ritechoice23)[ RSS](/packages/ritechoice23-laravel-chat-engine/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (4)Used By (0)

Laravel Chat Engine
===================

[](#laravel-chat-engine)

A UI-agnostic, transport-agnostic, polymorphic chat engine for Laravel.

[![Latest Version on Packagist](https://camo.githubusercontent.com/ef4b9aa5ca436f03bb9b8cd3cdc93c34a0233d4e69ecda4a7b3cd423d22d8c90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7269746563686f69636532332f6c61726176656c2d636861742d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ritechoice23/laravel-chat-engine)[![Tests](https://github.com/ritechoice23/laravel-chat-engine/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ritechoice23/laravel-chat-engine/actions)[![PHPStan](https://github.com/ritechoice23/laravel-chat-engine/actions/workflows/phpstan.yml/badge.svg)](https://github.com/ritechoice23/laravel-chat-engine/actions)[![Total Downloads](https://camo.githubusercontent.com/252093ca246f73d1638f342f012ec2b0f4e41cb4791d07fe4d9479a3650991fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7269746563686f69636532332f6c61726176656c2d636861742d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ritechoice23/laravel-chat-engine)[![License](https://camo.githubusercontent.com/b6636d2b513813099566d96574ac588993e9829c9dd51b618642be89e7ebdc39/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7269746563686f69636532332f6c61726176656c2d636861742d656e67696e65)](https://packagist.org/packages/ritechoice23/laravel-chat-engine)

Features
--------

[](#features)

- **Polymorphic Actors** - Users, Teams, Bots, or any model can chat
- **Thread Types** - Direct, Group, Channel, Broadcast, Custom
- **Rich Messages** - Text, Image, Video, Audio, File, Location, Contact, Custom
- **Attachments** - Multi-file uploads, view-once media, direct request uploads
- **Security** - Thread locks, PIN protection, E2E verification codes
- **Reactions** - Emoji reactions via `laravel-reactions` integration
- **Bookmarks** - Save/bookmark messages via `laravel-saveable` integration
- **Delivery Tracking** - Delivered and read receipts
- **Edit History** - Immutable message versions (configurable)
- **Soft/Hard Delete** - Configurable deletion modes
- **Authorization** - Built-in policies for threads and messages
- **Pipelines** - Message processing (sanitize, mentions, URLs, profanity)
- **Events** - Domain events for all actions
- **API Resources** - Ready-to-use JSON transformations

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x

Installation
------------

[](#installation)

```
composer require ritechoice23/laravel-chat-engine
```

Publish the config file:

```
php artisan vendor:publish --tag="chat-engine-config"
```

Run migrations:

```
php artisan migrate
```

Quick Start
-----------

[](#quick-start)

Add the trait to your User model:

```
use Ritechoice23\ChatEngine\Traits\CanChat;

class User extends Authenticatable
{
    use CanChat;
}
```

Start chatting:

```
use Ritechoice23\ChatEngine\Facades\Chat;

// Create a thread
$thread = Chat::thread()->between($userA, $userB)->create();

// Send a message
$message = Chat::message()
    ->from($userA)
    ->to($thread)
    ->text('Hello!')
    ->send();

// React to message
$userB->react($message, '❤️');

// Bookmark message
$userB->saveItem($message);

// Mark as read
$message->markAsReadBy($userB);
```

File Uploads
------------

[](#file-uploads)

Upload files directly from Laravel requests:

```
// Single file
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->text('Check this out!')
    ->attachUpload($request->file('photo'))
    ->send();

// Multiple files
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->attachUploads($request->file('attachments'))
    ->send();

// View-once (self-destructing)
Chat::message()
    ->from($request->user())
    ->to($thread)
    ->attachUploadViewOnce($request->file('secret'))
    ->send();
```

Message Types
-------------

[](#message-types)

```
// Text
Chat::message()->from($user)->to($thread)->text('Hello')->send();

// Image
Chat::message()->from($user)->to($thread)
    ->image('https://...', 'Caption')->send();

// Video
Chat::message()->from($user)->to($thread)
    ->video('https://...', 'thumb.jpg', 120)->send();

// File
Chat::message()->from($user)->to($thread)
    ->file('https://...', 'doc.pdf', 'application/pdf')->send();

// Location
Chat::message()->from($user)->to($thread)
    ->location(40.7128, -74.0060, 'NYC')->send();

// Contact
Chat::message()->from($user)->to($thread)
    ->contact('John Doe', '+1234567890', 'john@example.com')->send();
```

Thread Types
------------

[](#thread-types)

```
// Direct (1-on-1, automatically deduplicated)
Chat::thread()->between($userA, $userB)->create();

// Group
Chat::thread()->group('Team Chat')->participants([$u1, $u2, $u3])->create();

// Channel
Chat::thread()->channel('announcements')->create();

// Broadcast
Chat::thread()->broadcast('System Updates')->create();
```

Documentation
-------------

[](#documentation)

See [`/docs`](docs/README.md) for complete documentation:

Getting StartedCore FeaturesSystemAdvanced[Installation](docs/installation.md)[Threads](docs/threads.md)[Events](docs/events.md)[Encryption](docs/encryption.md)[Configuration](docs/configuration.md)[Messages](docs/messages.md)[Policies](docs/policies.md)[Retention](docs/retention.md)[Attachments](docs/attachments.md)[Pipelines](docs/pipelines.md)[Scaling](docs/scaling.md)[Security](docs/security.md)[Presence](docs/presence.md)[Customization](docs/customization.md)[Delivery](docs/delivery.md)[API Resources](docs/resources.md)[Reactions](docs/reactions.md)[Bookmarks](docs/bookmarks.md)Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability, please send an email to . All security vulnerabilities will be promptly addressed.

Credits
-------

[](#credits)

- [Daramola Babatunde Ebenezer](https://github.com/ritechoice23)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance85

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

123d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc2c3a32449f76aa8dfca355106fce6c5ade0effe7d22fa265493051e890aa40?d=identicon)[ritechoice23](/maintainers/ritechoice23)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![ritechoice23](https://avatars.githubusercontent.com/u/62488893?v=4)](https://github.com/ritechoice23 "ritechoice23 (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

chatchat-engineconversationseloquentlaravellaravel-frameworklaravel-packagemessagingpolymorphicreal-timelaraveleloquentreal-timemessagingchatconversationspolymorphicritechoice23chat-engine

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

484.2k](/packages/giacomomasseron-laravel-models-generator)

PHPackages © 2026

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