PHPackages                             sadeim/nard-laravel - 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. sadeim/nard-laravel

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

sadeim/nard-laravel
===================

Zero-config activity tracking for Laravel apps. Automatically tracks HTTP requests, auth events, model changes, and queue jobs. Powered by Nard Agent (https://nard.sadeim.com).

v0.1.0(2mo ago)04MITPHPPHP ^8.1CI passing

Since May 17Pushed 2mo agoCompare

[ Source](https://github.com/Sadeim/nard-laravel)[ Packagist](https://packagist.org/packages/sadeim/nard-laravel)[ Docs](https://nard.sadeim.com)[ RSS](/packages/sadeim-nard-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Nard for Laravel
================

[](#nard-for-laravel)

[![Latest Version](https://camo.githubusercontent.com/5bca3abd5fa1c58879d1fd6844c7f1411929bd92b05b2d82dec67dbfff91ca4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616465696d2f6e6172642d6c61726176656c2e737667)](https://packagist.org/packages/sadeim/nard-laravel)[![Tests](https://github.com/Sadeim/nard-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/Sadeim/nard-laravel/actions/workflows/tests.yml)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Zero-config activity tracking for Laravel applications.

Install the package and Nard automatically records what happens in your app — HTTP requests, logins, every Eloquent model change, and queue jobs — then streams it to the local [Nard Agent](https://nard.sadeim.com), which forwards it to Sadeim Central. No code changes, no manual instrumentation.

Why it's safe to leave on
-------------------------

[](#why-its-safe-to-leave-on)

- **Zero added latency.** HTTP tracking runs in *terminable* middleware — events are recorded and sent **after** the response has already been delivered to the visitor.
- **In-memory buffering.** Recording an event is just an array append (microseconds). The actual send to the agent happens once, post-response.
- **Loopback only.** The package talks solely to the local agent on `127.0.0.1`; every send is best-effort and failure is swallowed, so tracking can never break or slow your app.
- **Sensitive data is redacted** before anything leaves the server — see [SECURITY.md](SECURITY.md).

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- A running [Nard Agent](https://nard.sadeim.com) on the same server (listening on `127.0.0.1:8765` by default)

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

[](#installation)

```
composer require sadeim/nard-laravel
```

The service provider and the `Nard` facade are auto-discovered. That's it — tracking is now on.

Optionally publish the config file to tune behaviour:

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

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

[](#configuration)

All settings live in `config/nard.php` and can be driven by environment variables.

KeyEnvDefaultPurpose`enabled``NARD_ENABLED``true`Master on/off switch.`agent_url``NARD_AGENT_URL``http://127.0.0.1:8765`Local agent receiver.`timeout``NARD_TIMEOUT``1.0`Connect/total timeout (seconds) for the post-response send.`track.http``NARD_TRACK_HTTP``true`Track every HTTP request.`track.auth``NARD_TRACK_AUTH``true`Track login / logout / failed / registered.`track.models``NARD_TRACK_MODELS``true`Track Eloquent create / update / delete.`track.queue``NARD_TRACK_QUEUE``true`Track queue job processed / failed.`sample_rate``NARD_SAMPLE_RATE``1.0`Fraction of HTTP requests to record (0.0–1.0).`max_events_per_request``NARD_MAX_EVENTS``500`Per-request buffer cap.`sanitize_fields`—see configField names redacted from every payload.`exclude_models`—`DatabaseNotification`Eloquent classes to skip.`exclude_routes`—`telescope*`, `horizon*`, …Request paths to skip (`Request::is()` patterns).To turn everything off without uninstalling:

```
NARD_ENABLED=false
```

On a very high-traffic app you can sample HTTP requests (auth, model and queue events are always recorded in full):

```
NARD_SAMPLE_RATE=0.2
```

Automatic tracking
------------------

[](#automatic-tracking)

Once installed, the following are captured with no further work:

- **HTTP** — method, path, status code, duration, source IP, user agent.
- **Auth** — `auth.login`, `auth.logout`, `auth.failed`, `auth.registered`.
- **Models** — `model.created` / `model.updated` / `model.deleted`, with the changed scalar attributes (sensitive ones redacted).
- **Queue** — `queue.processed` and `queue.failed`.

Manual tracking
---------------

[](#manual-tracking)

Use the `Nard` facade for *named business events* that span more than one model — automatic tracking already covers the rest.

```
use Sadeim\Nard\Facades\Nard;
```

### `Nard::track()`

[](#nardtrack)

```
Nard::track('checkout.completed', [
    'target_type' => 'Order',
    'target_id'   => $order->id,
    'payload'     => ['total' => $order->total, 'currency' => 'USD'],
]);
```

### `Nard::activity()` — fluent builder

[](#nardactivity--fluent-builder)

```
Nard::activity('checkout.completed')
    ->actor($user)                       // or ->actorId('42', 'Sara')
    ->target('Order', $order->id)
    ->targetName("Order #{$order->id}")
    ->action('completed')
    ->payload(['total' => $order->total])
    ->with('currency', 'USD')
    ->record();
```

If no actor is set, the currently authenticated user is used automatically.

### `Nard::batch()`

[](#nardbatch)

In long-running processes (console commands, daemons) there is no HTTP response to flush on. Wrap a unit of work in `batch()` to record it and immediately ship whatever it tracked:

```
Nard::batch(function () {
    foreach ($invoices as $invoice) {
        $invoice->markPaid();                 // tracked automatically
        Nard::track('invoice.reconciled', ['target_id' => $invoice->id]);
    }
});
```

Security
--------

[](#security)

Sensitive values (passwords, tokens, card numbers, …) are redacted from every payload before it leaves your server, recursively and case-insensitively. The list is configurable. See [SECURITY.md](SECURITY.md)for the full default set and how to extend or exclude.

Testing
-------

[](#testing)

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

Links
-----

[](#links)

- Documentation:
- Nard:
- Sadeim:

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c691aa6be7693058cd3106f50fe7b9a2a80e4a4586a0b65c555827bf19fef82?d=identicon)[hosniabushbak](/maintainers/hosniabushbak)

---

Top Contributors

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

---

Tags

laravelmonitoringeventsactivity-trackingobservabilityaudit-lognardsadeim

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sadeim-nard-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/sadeim-nard-laravel/health.svg)](https://phpackages.com/packages/sadeim-nard-laravel)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M1.0k](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k4.0k](/packages/leantime-leantime)[treblle/treblle-laravel

Runtime Intelligence Platform

135226.0k](/packages/treblle-treblle-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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