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

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

dansketic/messenger
===================

Simple user messaging tool for Laravel

2.13.1(9y ago)023MITPHPPHP &gt;=5.4.0

Since Nov 21Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (43)Used By (0)

[![Build Status](https://camo.githubusercontent.com/2e3c673a8bf51e9d1e657aa812d10b02487aa62e8ba29f3bb19e8803766d9eb3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/cmgmyr/laravel-messenger)[![Scrutinizer](https://camo.githubusercontent.com/25d90e84554462042182395fba64af6244e92102ba14f9496e6eb31493619370/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/cmgmyr/laravel-messenger/)[![Scrutinizer Coverage](https://camo.githubusercontent.com/f6d0ac033651e6c7a97a0152f5d8956fcd40c8ee48ca5227ce29c0a5ca099922/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/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)[![Stories in Ready](https://camo.githubusercontent.com/0880aa710f04ad9ac2f6b5cbca4f9aaf256e634c2138de86999cb148e56753d5/68747470733a2f2f62616467652e776166666c652e696f2f636d676d79722f6c61726176656c2d6d657373656e6765722e7376673f6c6162656c3d7265616479267469746c653d5265616479)](http://waffle.io/cmgmyr/laravel-messenger)[![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' => [
    DanSketic\Messenger\MessengerServiceProvider::class,
]

```

Publish config:

```
php artisan vendor:publish --provider="DanSketic\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, 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',

```

Publish migrations:

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

```

Migrate your database:

```
php artisan migrate

```

Add the trait to your user model:

```
use DanSketic\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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 81.7% 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 ~18 days

Recently: every ~42 days

Total

41

Last Release

3444d 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

v1.x-dev → 2.102016-02-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/5564a2828e3b2485076e7ac15fafef53b47942bcb3fc20c51827992182e5c288?d=identicon)[DanSketic](/maintainers/DanSketic)

---

Top Contributors

[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (179 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (8 commits)")[![DanSketic](https://avatars.githubusercontent.com/u/23483901?v=4)](https://github.com/DanSketic "DanSketic (6 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (6 commits)")[![wiledia](https://avatars.githubusercontent.com/u/16577250?v=4)](https://github.com/wiledia "wiledia (3 commits)")[![danbalarin](https://avatars.githubusercontent.com/u/8071168?v=4)](https://github.com/danbalarin "danbalarin (3 commits)")[![gamemovies](https://avatars.githubusercontent.com/u/3316843?v=4)](https://github.com/gamemovies "gamemovies (2 commits)")[![anhskohbo](https://avatars.githubusercontent.com/u/1529454?v=4)](https://github.com/anhskohbo "anhskohbo (2 commits)")[![A5hleyRich](https://avatars.githubusercontent.com/u/1422996?v=4)](https://github.com/A5hleyRich "A5hleyRich (2 commits)")[![ognjenm](https://avatars.githubusercontent.com/u/609541?v=4)](https://github.com/ognjenm "ognjenm (2 commits)")[![adamwathan](https://avatars.githubusercontent.com/u/4323180?v=4)](https://github.com/adamwathan "adamwathan (1 commits)")[![DODMax](https://avatars.githubusercontent.com/u/1137276?v=4)](https://github.com/DODMax "DODMax (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)")[![UnrulyNatives](https://avatars.githubusercontent.com/u/6769986?v=4)](https://github.com/UnrulyNatives "UnrulyNatives (1 commits)")[![mickaelandrieu](https://avatars.githubusercontent.com/u/1247388?v=4)](https://github.com/mickaelandrieu "mickaelandrieu (1 commits)")

---

Tags

laravelmessagingMessengeruser messaging

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/dansketic-messenger/health.svg)](https://phpackages.com/packages/dansketic-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.0M682](/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)
