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

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

jacobcyl/laravel-messenger
==========================

Simple user messaging tool for Laravel

2.1.1(9y ago)134MITPHPPHP &gt;=5.4.0

Since Jan 29Pushed 9y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (8)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/2e3c673a8bf51e9d1e657aa812d10b02487aa62e8ba29f3bb19e8803766d9eb3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/cmgmyr/laravel-messenger)[![Code Climate](https://camo.githubusercontent.com/7c25ec23d0186324c2156cae8ca8eb9f25cfd3961c3329235a3adb9e7423f09f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/cmgmyr/laravel-messenger)[![Latest Version](https://camo.githubusercontent.com/d3ad6787c1a60322e101b0730bd6c3098981e1f70b28701b742c101ca4eddff1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://github.com/cmgmyr/laravel-messenger/releases)[![Total Downloads](https://camo.githubusercontent.com/e7b13f89c9efc910b48e6c175ecd60e9692b06018ef0152b8c431f6685c1ad8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636d676d79722f6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cmgmyr/messenger)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Get help on Codementor](https://camo.githubusercontent.com/946849bf79fb5d17765232b1fe38f4184923e7d4e532bcb028dd14b2b26ecc52/68747470733a2f2f63646e2e636f64656d656e746f722e696f2f6261646765732f6765745f68656c705f6769746875622e737667)](https://www.codementor.io/cmgmyr)

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 acess 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)

Installation (Laravel 4.x)
--------------------------

[](#installation-laravel-4x)

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

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

[](#installation-laravel-5x)

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,
]

```

Publish Assets

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

```

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, simply use [this example](https://github.com/cmgmyr/laravel-messenger/tree/master/src/Cmgmyr/Messenger/examples/create_users_table.php) as a starting point, then migrate.

**(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',

```

Migrate your database:

```
php artisan migrate

```

Add the trait to your user model:

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

class User extends Model {
    use Messagable;
}

```

Examples
--------

[](#examples)

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

**Note:** These examples use the [laravelcollective/html](http://laravelcollective.com/docs/5.0/html) package that is no longer included in Laravel 5 out of the box. Make sure you require this dependency in your `composer.json` file if you intend to use the example files.

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 format your code before creating a pull-request. This will format all files as specified in `.php_cs`:

```
vendor/bin/php-cs-fixer fix .

```

Security
--------

[](#security)

If you discover any security related issues, please email [Chris Gmyr](mailto:cmgmyr@gmail.com) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chris Gmyr](https://github.com/cmgmyr)
- [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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80.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 ~32 days

Recently: every ~14 days

Total

7

Last Release

3564d ago

Major Versions

v1.x-dev → v2.x-dev2016-02-25

1.0.1 → 2.0.02016-06-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/5cbb3952a18af26031f23cc229cfc3b624181cd8015330da149d3d8e0c54c361?d=identicon)[jacobcyl](/maintainers/jacobcyl)

---

Top Contributors

[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (139 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (6 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (6 commits)")[![jacobcyl](https://avatars.githubusercontent.com/u/906128?v=4)](https://github.com/jacobcyl "jacobcyl (5 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)")[![ognjenm](https://avatars.githubusercontent.com/u/609541?v=4)](https://github.com/ognjenm "ognjenm (2 commits)")[![UnrulyNatives](https://avatars.githubusercontent.com/u/6769986?v=4)](https://github.com/UnrulyNatives "UnrulyNatives (1 commits)")[![adamwathan](https://avatars.githubusercontent.com/u/4323180?v=4)](https://github.com/adamwathan "adamwathan (1 commits)")[![Raou1d](https://avatars.githubusercontent.com/u/6343069?v=4)](https://github.com/Raou1d "Raou1d (1 commits)")[![tzookb](https://avatars.githubusercontent.com/u/3749973?v=4)](https://github.com/tzookb "tzookb (1 commits)")[![DODMax](https://avatars.githubusercontent.com/u/1137276?v=4)](https://github.com/DODMax "DODMax (1 commits)")

---

Tags

laravelmessagingMessengeruser messaging

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cmgmyr/messenger

Simple user messaging tool for Laravel

2.6k2.4M6](/packages/cmgmyr-messenger)[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[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)
