PHPackages                             cmgmyr/messenger - 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. cmgmyr/messenger

ActiveLibrary

cmgmyr/messenger
================

Simple user messaging tool for Laravel

2.32.0(2mo ago)2.6k2.4M—6.2%515[1 PRs](https://github.com/cmgmyr/laravel-messenger/pulls)6MITPHPPHP ^7.2|^8.0CI passing

Since Nov 21Pushed 2mo ago95 watchersCompare

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

READMEChangelog (10)Dependencies (16)Versions (66)Used By (6)

[![SQLite Tests](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests.yml/badge.svg)](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests.yml)[![MySQL Tests](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests-mysql.yml/badge.svg)](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests-mysql.yml)[![PostgreSQL Tests](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests-postgres.yml/badge.svg)](https://github.com/cmgmyr/laravel-messenger/actions/workflows/run-tests-postgres.yml)

[![Latest Version](https://camo.githubusercontent.com/238a322bd8a155e870aaa9569b88f267b48f338e2f3b9d1f243d6cb5c502facc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636d676d79722f6c61726176656c2d6d657373656e6765722e737667)](https://github.com/cmgmyr/laravel-messenger/releases)[![Total Downloads](https://camo.githubusercontent.com/eeb3895b4007c88803d63dcae7ff832b199e31a285ed31bf3000fa748b4d6d1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636d676d79722f6d657373656e6765722e737667)](https://packagist.org/packages/cmgmyr/messenger)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

Laravel Messenger
=================

[](#laravel-messenger)

This package will allow you to add a full user messaging system into your Laravel application.

Leave some feedback
-------------------

[](#leave-some-feedback)

[How are you using laravel-messenger?](https://github.com/cmgmyr/laravel-messenger/issues/55)

Features
--------

[](#features)

- Multiple conversations per user
- Optionally loop in additional users with each new message
- View the last message for each thread available
- Returns either all messages in the system, all messages associated to the user, or all message associated to the user with new/unread messages
- Return the users unread message count easily
- Very flexible usage so you can implement your own access control

Common uses
-----------

[](#common-uses)

- Open threads (everyone can see everything)
- Group messaging (only participants can see their threads)
- One to one messaging (private or direct thread)

Laravel Versions
----------------

[](#laravel-versions)

LaravelMessenger4.\*1.\*5.0-5.4&lt;= 2.16.25.5+2.\*Installation (Laravel 4.x - no longer actively supported)
---------------------------------------------------------

[](#installation-laravel-4x---no-longer-actively-supported)

Installation instructions for Laravel 4 can be [found here](https://github.com/cmgmyr/laravel-messenger/tree/v1).

Installation (Laravel 5.x)
--------------------------

[](#installation-laravel-5x)

```
composer require cmgmyr/messenger

```

Or place manually in composer.json:

```
"require": {
    "cmgmyr/messenger": "~2.0"
}

```

Run:

```
composer update

```

Add the service provider to `config/app.php` under `providers`:

```
'providers' => [
    Cmgmyr\Messenger\MessengerServiceProvider::class,
],
```

> **Note**: If you are using Laravel 5.5, this step is unnecessary. Laravel Messenger supports [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery).

Publish config:

```
php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider" --tag="config"

```

Update config file to reference your User Model:

```
config/messenger.php

```

Create a `users` table if you do not have one already. If you need one, the default Laravel migration will be satisfactory.

**(Optional)** Define names of database tables in package config file if you don't want to use default ones:

```
'messages_table' => 'messenger_messages',
'participants_table' => 'messenger_participants',
'threads_table' => 'messenger_threads',
```

Publish migrations:

```
php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider" --tag="migrations"

```

Migrate your database:

```
php artisan migrate

```

Add the trait to your user model:

```
use Cmgmyr\Messenger\Traits\Messagable;

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

Examples
--------

[](#examples)

- [Controller](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/MessagesController.php)
- [Routes](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/routes.php)
- [Views](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/views)

Example Projects
----------------

[](#example-projects)

- \[WIP\] [Pusher](https://github.com/cmgmyr/laravel-messenger-pusher-demo)
- \[WIP\] [Lumen API](https://github.com/cmgmyr/lumen-messenger-api)

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

[](#contributing)

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

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

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Chris Gmyr](https://github.com/cmgmyr)
- [Anton Komarev](https://github.com/antonkomarev)
- [All Contributors](../../contributors)

### Special Thanks

[](#special-thanks)

This package used [AndreasHeiberg/laravel-messenger](https://github.com/AndreasHeiberg/laravel-messenger) as a starting point.

###  Health Score

74

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity70

Solid adoption and visibility

Community43

Growing community involvement

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.8% 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 ~270 days

Total

65

Last Release

62d ago

Major Versions

1.7.1 → 2.82015-09-27

1.8 → 2.8.12015-10-06

1.8.1 → 2.92015-12-11

1.8.2 → 2.9.12016-01-29

1.x-dev → 2.102016-02-25

PHP version history (5 changes)1.0PHP &gt;=5.4.0

2.15PHP &gt;=5.5.0

2.17PHP ^7.1.3

2.21PHP ^7.2

2.22PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d987f3caa2f921deded28dc8cf4a6f8ecb6cd6acf79ebd5f7d6191835ba7f1a?d=identicon)[cmgmyr](/maintainers/cmgmyr)

---

Top Contributors

[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (281 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (29 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (6 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (4 commits)")[![C0kkie](https://avatars.githubusercontent.com/u/20169938?v=4)](https://github.com/C0kkie "C0kkie (4 commits)")[![danbalarin](https://avatars.githubusercontent.com/u/8071168?v=4)](https://github.com/danbalarin "danbalarin (3 commits)")[![A5hleyRich](https://avatars.githubusercontent.com/u/1422996?v=4)](https://github.com/A5hleyRich "A5hleyRich (2 commits)")[![anhskohbo](https://avatars.githubusercontent.com/u/1529454?v=4)](https://github.com/anhskohbo "anhskohbo (2 commits)")[![gamemovies](https://avatars.githubusercontent.com/u/3316843?v=4)](https://github.com/gamemovies "gamemovies (2 commits)")[![kenzouno1](https://avatars.githubusercontent.com/u/1946802?v=4)](https://github.com/kenzouno1 "kenzouno1 (2 commits)")[![ognjenm](https://avatars.githubusercontent.com/u/609541?v=4)](https://github.com/ognjenm "ognjenm (2 commits)")[![igorbabko](https://avatars.githubusercontent.com/u/9337772?v=4)](https://github.com/igorbabko "igorbabko (1 commits)")[![injektion](https://avatars.githubusercontent.com/u/3210129?v=4)](https://github.com/injektion "injektion (1 commits)")[![tzookb](https://avatars.githubusercontent.com/u/3749973?v=4)](https://github.com/tzookb "tzookb (1 commits)")[![adamwathan](https://avatars.githubusercontent.com/u/4323180?v=4)](https://github.com/adamwathan "adamwathan (1 commits)")[![messerli90](https://avatars.githubusercontent.com/u/3306651?v=4)](https://github.com/messerli90 "messerli90 (1 commits)")[![mickaelandrieu](https://avatars.githubusercontent.com/u/1247388?v=4)](https://github.com/mickaelandrieu "mickaelandrieu (1 commits)")[![nikolaynesov](https://avatars.githubusercontent.com/u/17743574?v=4)](https://github.com/nikolaynesov "nikolaynesov (1 commits)")[![UnrulyNatives](https://avatars.githubusercontent.com/u/6769986?v=4)](https://github.com/UnrulyNatives "UnrulyNatives (1 commits)")[![AbdullahFaqeir](https://avatars.githubusercontent.com/u/1428547?v=4)](https://github.com/AbdullahFaqeir "AbdullahFaqeir (1 commits)")

---

Tags

composercomposer-packageshacktoberfestlaravellaravel-messengermessengerpackagephplaravelmessagingMessengeruser messaging

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cmgmyr-messenger/health.svg)

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

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[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)[syntaxlexx/chatmessenger

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

10510.2k](/packages/syntaxlexx-chatmessenger)

PHPackages © 2026

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