PHPackages                             phunky/laravel-messaging-groups - 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. phunky/laravel-messaging-groups

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

phunky/laravel-messaging-groups
===============================

Group conversations extension for phunky/laravel-messaging

0.1.1(1mo ago)00MITPHPPHP ^8.4CI passing

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/Phunky/laravel-messaging-groups)[ Packagist](https://packagist.org/packages/phunky/laravel-messaging-groups)[ Docs](https://github.com/phunky/laravel-messaging-groups)[ RSS](/packages/phunky-laravel-messaging-groups/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (12)Versions (5)Used By (0)

Laravel Messaging Groups
========================

[](#laravel-messaging-groups)

Group conversations extension for [phunky/laravel-messaging](https://github.com/phunky/laravel-messaging).

Groups have an owner, name, optional avatar, and a backing `Conversation` — so all core messaging features work out of the box.

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

[](#installation)

```
composer require phunky/laravel-messaging-groups
```

Register the group model and extension in `config/messaging.php` (add to the existing `models` and `extensions` arrays — do not remove the core keys):

```
'models' => [
    // ... conversation, participant, message, event
    'group' => \Phunky\LaravelMessagingGroups\Group::class,
],

'extensions' => [
    // ... other MessagingExtension classes, if any
    \Phunky\LaravelMessagingGroups\GroupsExtension::class,
],
```

```
php artisan migrate
```

Usage
-----

[](#usage)

Resolve `GroupService` via the container (constructor injection, `app(GroupService::class)`, etc.):

```
use Phunky\LaravelMessagingGroups\GroupService;

$groupService = app(GroupService::class);
```

### Create a group

[](#create-a-group)

```
$group = $groupService->create(
    owner: $user,
    name: 'Project Alpha',
    avatar: 'avatars/project-alpha.png',    // optional
    meta: ['color' => '#4f46e5'],           // optional JSON meta on the group
);
```

The owner is added as the first participant automatically.

### Manage participants

[](#manage-participants)

Only the **group owner** may `invite`, `remove`, or `transferOwnership`. `invite` is idempotent for existing participants.

```
$groupService->invite($group, $owner, $newMember);
$groupService->remove($group, $owner, $memberToRemove);
$groupService->transferOwnership($group, $owner, $newOwner);
$groupService->leave($group, $member);
```

The owner cannot `remove` themselves or `leave` until they `transferOwnership` to another participant.

### Send and read messages

[](#send-and-read-messages)

```
$message = $groupService->send($group, $sender, 'Hello everyone!');
$message = $groupService->send($group, $sender, 'With meta', meta: ['url' => 'https://example.com']);

$messages = $groupService->messages($group); // CursorPaginator or LengthAwarePaginator
```

### Relationships

[](#relationships)

```
$group->conversation;
$group->owner;
$group->participants()->get();
```

Events
------

[](#events)

All group events extend [`Phunky\LaravelMessaging\Events\BroadcastableMessagingEvent`](https://github.com/phunky/laravel-messaging) and broadcast on the same private conversation channels as core messaging when `config('messaging.broadcasting.enabled')` is `true`. With Laravel Echo, listen using the `broadcastAs()` name with a **leading dot** (e.g. `.listen('.messaging.group.created', …)`).

EventPublic properties`broadcastAs()``GroupCreated``$group`, `$owner``messaging.group.created``GroupParticipantInvited``$group`, `$participant`, `$invitedBy``messaging.group.participant_invited``GroupParticipantRemoved``$group`, `$removed`, `$removedBy``messaging.group.participant_removed``GroupParticipantLeft``$group`, `$participant``messaging.group.participant_left``GroupOwnershipTransferred``$group`, `$previousOwner`, `$newOwner``messaging.group.ownership_transferred`Messages sent through the group still dispatch the core `Phunky\LaravelMessaging\Events\MessageSending` and `Phunky\LaravelMessaging\Events\MessageSent` events.

```
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use Phunky\LaravelMessagingGroups\Events\GroupParticipantInvited;

Event::listen(GroupParticipantInvited::class, function (GroupParticipantInvited $event) {
    // Your User (or other messageable) must use Illuminate\Notifications\Notifiable for Notification::send.
    Notification::send($event->participant->messageable, new \App\Notifications\AddedToGroup($event->group));
});
```

Create `App\Notifications\AddedToGroup` (or swap in your own notification class).

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance92

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% 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 ~8 days

Total

3

Last Release

39d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelgroupschatlaravel-messaging

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/phunky-laravel-messaging-groups/health.svg)

```
[![Health](https://phpackages.com/badges/phunky-laravel-messaging-groups/health.svg)](https://phpackages.com/packages/phunky-laravel-messaging-groups)
```

###  Alternatives

[musonza/chat

Chat Package for Laravel

1.2k267.5k1](/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

10725.0k](/packages/lexxyungcarter-chatmessenger)

PHPackages © 2026

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