PHPackages                             minitor/agent - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. minitor/agent

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

minitor/agent
=============

Self-hosted local agent that replaces Laravel Nightwatch's closed-source agent.phar and forwards telemetry to a self-hosted MINITOR server.

v1.0.2(3d ago)08MITPHP ^8.2

Since Jul 7Compare

[ Source](https://github.com/enioladev1/minitor-agent)[ Packagist](https://packagist.org/packages/minitor/agent)[ RSS](/packages/minitor-agent/feed)WikiDiscussions Synced today

READMEChangelogDependencies (6)Versions (4)Used By (0)

 [![MINITOR](.github/logo.png)](.github/logo.png)

minitor/agent
=============

[](#minitoragent)

Self-hosted replacement for Laravel Nightwatch's closed-source local agent (`agent.phar`). Installing this package pulls in the official, unmodified [`laravel/nightwatch`](https://github.com/laravel/nightwatch) package as a dependency - that's the real Laravel-maintained instrumentation (request timing, query listener, exception handler, queue events, etc.), completely untouched. This package only replaces the piece Laravel never open-sourced: the local agent that receives from it. Instead of forwarding to Laravel's hosted service, it forwards to your own self-hosted [MINITOR](https://github.com/enioladev1/minitor) server.

`laravel/nightwatch` already knows how to talk to a local agent on `127.0.0.1:2407` - this package speaks that same protocol, so no changes to `laravel/nightwatch` or your application code are needed.

This package is only useful alongside a running MINITOR server. See [github.com/enioladev1/minitor](https://github.com/enioladev1/minitor) to self-host that first - it's where you create a project and get both values this agent needs below. You never invent or generate either one yourself; the dashboard generates both together and shows them as a ready-to-paste snippet in the project's Settings dialog.

Install
-------

[](#install)

On the Laravel app you want to monitor, one command installs both this agent and `laravel/nightwatch` itself:

```
composer require minitor/agent
```

Paste the snippet from your project's Settings dialog into `.env` - it looks like this, with both values already filled in for you:

```
NIGHTWATCH_TOKEN=
MINITOR_SERVER_URL=https://minitor.example.com
MINITOR_PROJECT_TOKEN=

```

Nightwatch's own `NIGHTWATCH_INGEST_URI` (what this agent listens on) and this agent's `MINITOR_AGENT_LISTEN` already default to the same `127.0.0.1:2407`, so nothing extra is needed there unless you're changing that port.

`NIGHTWATCH_TOKEN` never leaves this server - it's only used locally to verify frames came from this app's own Nightwatch instance. It's named `NIGHTWATCH_TOKEN` (not something MINITOR-branded) because that's the exact environment variable the real, unmodified `laravel/nightwatch`package reads for it - we can't rename that without forking Nightwatch. `MINITOR_PROJECT_TOKEN` is what authenticates this app's data to your central MINITOR dashboard. Regenerating the project in the dashboard rotates both values together - update `.env` again after doing so.

Run the agent (keep it running with Supervisor, systemd, Forge's daemon manager, etc. - same operational requirement as Nightwatch's own agent):

```
php artisan minitor:agent
```

Configuration
-------------

[](#configuration)

Publish the config file to customize buffer thresholds or which record types get forwarded:

```
php artisan vendor:publish --tag=minitor-config
```

See [`config/minitor.php`](config/minitor.php) for all options.

How it works
------------

[](#how-it-works)

`laravel/nightwatch` frames every batch of telemetry as `{length}:{version}:{tokenHash}:{payload}` and sends it over a local TCP connection, expecting a 4-byte `2:OK` acknowledgement back - this is exactly what Laravel's real (closed-source) agent does too. This package's `AgentServer` implements that same protocol (see [`src/Protocol/FrameDecoder.php`](src/Protocol/FrameDecoder.php) and [`src/Protocol/TokenHasher.php`](src/Protocol/TokenHasher.php)), decodes each record, buffers them, and forwards batches to your MINITOR server's `POST /api/ingest` over HTTPS.

Testing
-------

[](#testing)

```
composer install
./vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance99

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

3

Last Release

3d ago

### Community

Maintainers

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

---

Tags

laravelmonitoringobservabilityself hostednightwatch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/minitor-agent/health.svg)

```
[![Health](https://phpackages.com/badges/minitor-agent/health.svg)](https://phpackages.com/packages/minitor-agent)
```

###  Alternatives

[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M216](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M170](/packages/spatie-laravel-health)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2382.1M5](/packages/inspector-apm-inspector-laravel)

PHPackages © 2026

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