PHPackages                             murkrow/simple-chat - 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. murkrow/simple-chat

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

murkrow/simple-chat
===================

0.6.5(1y ago)0392PHP

Since Aug 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Murkrow02/simple-chat)[ Packagist](https://packagist.org/packages/murkrow/simple-chat)[ RSS](/packages/murkrow-simple-chat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

simple-chat
===========

[](#simple-chat)

A simple Laravel package to add intuitive and simple chat logic to your application

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

[](#requirements)

- Axios
- TailwindCSS

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

[](#installation)

1 - Install the package via composer:

```
composer require murkrow/simple-chat
```

2 - Publish the package files:

```
php artisan vendor:publish --provider="Murkrow\Chat\ChatServiceProvider" --force
```

3 - Set your pusher credentials in your `.env` file:

```
PUSHER_APP_ID=your-pusher-app-id
PUSHER_APP_KEY=your-pusher-key
PUSHER_APP_SECRET=your-pusher-secret
PUSHER_APP_CLUSTER=mt1
BROADCAST_DRIVER=pusher
```

4 - Include also the following variables in your `.env` file:

```
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
```

5 - Install the laravel echo and pusher npm packages:

```
npm install --save-dev laravel-echo pusher-js
```

6 - Install the laravel pusher composer package:

```
composer require pusher/pusher-php-server
```

7 - Add the following code to your `resources/js/bootstrap.js` file:

```
import Echo from 'laravel-echo';

import Pusher from 'pusher-js';
window.Pusher = Pusher;

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: import.meta.env.VITE_PUSHER_APP_KEY,
    cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
    wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
    wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
    wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
    forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
    enabledTransports: ['ws', 'wss'],
});
```

#### NOTE:

[](#note)

> Make sure to have uncommented App\\Providers\\BroadcastServiceProvider::class in your config/app.php file

Usage
-----

[](#usage)

Add the `CanChat` trait to your User model:

```
use Murkrow\Chat\Traits\CanChat;
class User
{
    use CanChat;
}
```

Customize the trait by overriding the following methods:

```
class User
{
    use CanChat;

    public function getSecondLineAttribute(): string
    {
        return $this->email;
    }
    public function getAvatarUrlAttribute(): string
    {
        return $this->avatar;
    }
    public function getUsersToStartChatWith() : Builder
    {
        return Utils::getUserClass()::where('id', '!=', $this->id);
    }

    public function canChatWith($targetUserId): bool
    {
        return $targetUserId->role !== 'admin';
    }
}
```

### Events

[](#events)

When a new message is sent, the package will broadcast a `NewMessage` event to the channel `chat.{chat_id}`.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance46

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~60 days

Recently: every ~146 days

Total

11

Last Release

404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b1466e76ca952c12721cc4358e28d82c25402f810954e0001acbf4cd38be3af?d=identicon)[murkrow](/maintainers/murkrow)

---

Top Contributors

[![Murkrow02](https://avatars.githubusercontent.com/u/38087157?v=4)](https://github.com/Murkrow02 "Murkrow02 (47 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/murkrow-simple-chat/health.svg)

```
[![Health](https://phpackages.com/badges/murkrow-simple-chat/health.svg)](https://phpackages.com/packages/murkrow-simple-chat)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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