PHPackages                             mallardduck/dynamic-echo-events - 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. mallardduck/dynamic-echo-events

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

mallardduck/dynamic-echo-events
===============================

A library that allows registering laravel-echo events dynamically and done entirely in PHP.

0.9.0(5y ago)14[2 issues](https://github.com/mallardduck/dynamic-echo-events/issues)MITPHPPHP ^7.4|^8.0CI failing

Since Nov 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mallardduck/dynamic-echo-events)[ Packagist](https://packagist.org/packages/mallardduck/dynamic-echo-events)[ Docs](https://github.com/mallardduck/dynamic-echo-events)[ RSS](/packages/mallardduck-dynamic-echo-events/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (11)Versions (21)Used By (0)

Dynamic Echo Events
===================

[](#dynamic-echo-events)

[![Travis Build Status](https://camo.githubusercontent.com/c6a5030cdbddfcb6ba7dde4041a0c0dab061bc08947dadaafe082d755b2e7f7d/68747470733a2f2f7472617669732d63692e636f6d2f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732e7376673f6272616e63683d6d61696e)](https://travis-ci.com/mallardduck/dynamic-echo-events)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e4ed4a74c236c014a09f03786d646396843024f67b4e9b74b5a090d710fc94bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/mallardduck/dynamic-echo-events/?branch=main)[![Code Coverage](https://camo.githubusercontent.com/235232c38fc07fd53f6bd5cf16e58aedee8e5b0ecc81aa6a2027b996349e61a9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/mallardduck/dynamic-echo-events/?branch=main)[![Latest Stable Version](https://camo.githubusercontent.com/4ab6817f66e8261ed2abebf6006a26c0d3ecc60a3438f802a1b1486515a25336/68747470733a2f2f706f7365722e707567782e6f72672f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f762f737461626c65)](https://packagist.org/packages/mallardduck/dynamic-echo-events)[![License](https://camo.githubusercontent.com/9a0be3a019a455c63fb0ff96c871ef8378b4d9a275d3231b03628f5ca1a18be3/68747470733a2f2f706f7365722e707567782e6f72672f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f6c6963656e7365)](https://packagist.org/packages/mallardduck/dynamic-echo-events)[![Coveralls Coverage Status](https://camo.githubusercontent.com/2fddf9795bdf45e9f6a7883f5cdf2f9e38cc336d8aace6c5ed64c1a437fc98ae/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/mallardduck/dynamic-echo-events?branch=main)[![Code Intelligence Status](https://camo.githubusercontent.com/f75cec94d795ec660d23657bc519f0f07398e202e9e892db1176d22e929cf456/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d616c6c6172646475636b2f64796e616d69632d6563686f2d6576656e74732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)

A helper library to dynamically generate the javascript to register Echo event listeners.

Instead of manually writing JS code to register Echo event listeners, simply define the JS handler callback in the Event. Then add the `ImplementsDynamicEcho` contact and use the `PrivateDynamicEchoChannel` trait.

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

[](#installation)

You can install the package via composer:

```
composer require mallardduck/dynamic-echo-events
```

You can publish the config file with:

```
php artisan vendor:publish --provider="MallardDuck\DynamicEcho\DynamicEchoServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'namespace' => env('DYNAMIC_ECHO_NS', 'App\\Events')
];
```

Usage
-----

[](#usage)

First, you will need to make sure that your site's `app.js` file properly configures the Echo javascript client. This ensures the generated code has the necessary requirements.

Then, modify your sites base theme files to load the dynamic echo generated javascript. This should be done at a point in the template where the main `app.js` is loaded.

Add in:

```
@dynamicEcho
```

Finally, when you want an event to automatically register itself in the browser use the Event contact and trait. This is done simply by adding the `ImplementsDynamicEcho` contact and use the `PrivateDynamicEchoChannel` trait to the event.

Check the `examples` folder for working example(s) of how this is done.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [mallardduck](https://github.com/mallardduck)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~0 days

Total

15

Last Release

2050d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/801be8ba9bfb0cb2629f51f9753a0392683c2680fe3e941a188495840d920333?d=identicon)[MallardDuck](/maintainers/MallardDuck)

---

Top Contributors

[![mallardduck](https://avatars.githubusercontent.com/u/619938?v=4)](https://github.com/mallardduck "mallardduck (80 commits)")

---

Tags

laravelpusherSocket.iolaravel-echolaravel-websocketsmallardducklaravel-events

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mallardduck-dynamic-echo-events/health.svg)

```
[![Health](https://phpackages.com/badges/mallardduck-dynamic-echo-events/health.svg)](https://phpackages.com/packages/mallardduck-dynamic-echo-events)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[noerd/noerd

101.4k6](/packages/noerd-noerd)

PHPackages © 2026

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