PHPackages                             akbarali/nats-listener - 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. akbarali/nats-listener

ActiveLibrary

akbarali/nats-listener
======================

Laravel Nats Listener

0.2.0(1y ago)019MITPHPPHP &gt;=8.0

Since Dec 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/akbarali1/nats-php-listener)[ Packagist](https://packagist.org/packages/akbarali/nats-listener)[ RSS](/packages/akbarali-nats-listener/feed)WikiDiscussions main Synced 1mo ago

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

Laravel NATS PHP Listener
=========================

[](#laravel-nats-php-listener)

TODO
====

[](#todo)

Done ?NameVersion✅Add command `nats:pause` and `nats:continue`.0.1.5✅Write error messages more clearly and translate them into English.0.1.7⏳Write a Sender for this Listener.Pending⬜Writing documentation.In the future⬜Add middleware method.In the future⬜Add Docs Auth Middleware.In the futureInstall
=======

[](#install)

```
composer require akbarali/nats-listener

```

After installing Nats Listener, publish its assets using the `nats:install` Artisan command:

```
php artisan nats:install

```

Configuration
=============

[](#configuration)

After publishing Nats Listener's assets, its primary configuration file will be located at `config/nats.php`. This configuration file allows you to configure the queue worker options for your application. Each configuration option includes a description of its purpose, so be sure to thoroughly explore this file.

Running Nats Listener
=====================

[](#running-nats-listener)

Once you have configured your supervisors and workers in your application's `config/nats.php` configuration file, you may start Nats Listener using the `nats:listener` Artisan command. This single command will start all the configured worker processes for the current environment:

```
php artisan nats:listener

```

You may pause the Nats Listener process and instruct it to continue processing jobs using the `nats:pause` and `nats:continue` Artisan commands:

```
php artisan nats:pause

```

```
php artisan nats:continue

```

Deploying Nats Listener
=======================

[](#deploying-nats-listener)

When you're ready to deploy Nats Listener to your application's actual server, you should configure a process monitor to monitor the php artisan Nats Listener command and restart it if it exits unexpectedly. Don't worry, we'll discuss how to install a process monitor below. During your application's deployment process, you should instruct the Nats Listener process to terminate so that it will be restarted by your process monitor and receive your code changes:

```
php artisan nats:terminate

```

Supervisor Configuration
========================

[](#supervisor-configuration)

Supervisor configuration files are typically stored within your server's `/etc/supervisor/conf.d` directory. Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored. For example, let's create a `nats.conf` file that starts and monitors a nats listener process:

```
[program:nats_listener]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan nats:listener
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
numprocs=1
user=forge
redirect_stderr=true
stdout_logfile=/var/www/supervisor/nats_listener_queue.log

```

Emotional Damage
================

[](#emotional-damage)

I originally wrote this package because RabbitMQ was slow and had a lot of issues with our entire project. I thought NATS would be faster and more reliable. But in the end, it turned out that RabbitMQ is 25% faster.

[![alt text](/art/emotional-damage.gif)](/art/emotional-damage.gif)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

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

Total

11

Last Release

509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3228f32e213a2e306db99f2526c4ec31bac09c86e360db37bde696689f962a2?d=identicon)[akbarali](/maintainers/akbarali)

---

Top Contributors

[![akbarali1](https://avatars.githubusercontent.com/u/39323182?v=4)](https://github.com/akbarali1 "akbarali1 (28 commits)")

---

Tags

laravelnatsphplaravelnats

### Embed Badge

![Health badge](/badges/akbarali-nats-listener/health.svg)

```
[![Health](https://phpackages.com/badges/akbarali-nats-listener/health.svg)](https://phpackages.com/packages/akbarali-nats-listener)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[goodway/laravel-nats

Nats jetstream queue driver with client for Laravel

304.8k](/packages/goodway-laravel-nats)

PHPackages © 2026

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