PHPackages                             drcantagalo/laravel-monitor - 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. drcantagalo/laravel-monitor

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

drcantagalo/laravel-monitor
===========================

A lightweight Laravel package providing CRM tools, access monitoring, and anti-scraper protection.

v0.1.16(1w ago)011MITPHPPHP &gt;=8.1

Since Nov 19Pushed 1w agoCompare

[ Source](https://github.com/DrCantagalo/laravel-monitor)[ Packagist](https://packagist.org/packages/drcantagalo/laravel-monitor)[ RSS](/packages/drcantagalo-laravel-monitor/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (8)Dependencies (2)Versions (16)Used By (0)

Laravel Monitor (v0.1.13)
=========================

[](#laravel-monitor-v0113)

**Laravel Monitor** is an experimental package designed to test the initial installation flow for a lightweight Laravel package providing basic CRM tools, access monitoring, and anti-scraper features. Designed to track visits, manage sessions, and detect potentially malicious scrapers.

> ⚠️ **This is an early testing release.**
> The only purpose of v0.1.8 is validating installation, configuration storage, and server registration workflow.

Remember-me (returning visitor recognition)
-------------------------------------------

[](#remember-me-returning-visitor-recognition)

When `MonitorMethod` creates a new `Monitor` record for a first-time visitor (session-based, non-bot request), it generates a random token, stores it in `data['id-token']`, and attaches it to the response as a long-duration cookie so the same browser can be recognized again after its PHP session expires.

Contract for the front-end of the host application:

- **Cookie name**: `config('monitor.remember_cookie')`, default `monitor_id_token`. Duration: `config('monitor.remember_cookie_days')`days, default 1825 (5 years). The package sets this cookie itself — the front-end never needs to create or read it directly (it isn't meant to be parsed from `document.cookie`; the browser just carries it back automatically on every request).
- **Endpoint**: `GET /monitor/remember-me`. No request body needed — the cookie above travels with the request automatically. Call this once per page load, as early as possible (e.g. on page ready), for visitors that don't yet have an active recognized session. Response: `{"success": true}` when a matching visitor was found and merged into the current session, or `{"success": false, "message": "..."}` when there's no cookie yet (first-ever visit) or no matching record (cookie is stale/invalid).
- Calling the endpoint sets `session(['remember_me' => $token])`; the `MonitorMethod` middleware picks that up on the very same request (it runs after the controller, on the way back out) and merges the returning visitor into the current PHP session.

Arbitrary visitor data (segmentation/tags)
------------------------------------------

[](#arbitrary-visitor-data-segmentationtags)

Lets the host application's front-end attach arbitrary key/value pairs (language, tags, preferences, etc.) to the `Monitor` record of the current visitor session — a segmentation/tagging base, not a CRM/lead system yet.

- **Endpoint**: `GET /monitor/update-data?data[key]=value`. Requires an active monitor session (i.e. `MonitorMethod` must have already run at least once for this visitor — same precondition as `remember-me`). No request body needed, query string only, same GET-to-avoid-CSRF rationale as `remember-me`.
- Nested query params are read as-is: `?data[lang]=pt&data[tags][]=newsletter`merges `lang` and `tags` into the Monitor's `data`.
- **Protected keys**: `sessions`, `ips`, `visits`, `page`, `id-token`, `ua`are silently ignored if present in the payload — these are written exclusively by `MonitorMethod`/`Monitor::newVisit`, and letting the front-end overwrite them would corrupt tracking. Every other key is accepted freely (schema intentionally left open — see below).
- Response: `{"success": true, "monitor_id": }` on success; `{"success": false, "message": "..."}` (400) when there's no active monitor session yet, or (422) when no `data` payload was sent.
- Design note: the schema is deliberately unconstrained so it can later support linking a visitor to a real lead/contact, an opt-in shared blacklist across sites, or an external IP-reputation feed — none of which this action builds today.

Ephemeral read token + dedicated CORS (dashboard direct fetch)
--------------------------------------------------------------

[](#ephemeral-read-token--dedicated-cors-dashboard-direct-fetch)

The dashboard (`monitor.cantagalo.it`) can call `/monitor/handler?action=getData`directly from the end user's browser instead of always proxying through the host application's server. The permanent `local_token` never leaves the host application's backend — only a short-lived, read-only token does.

- **`issueReadToken`** (`Authorization: Bearer `, same auth as the other admin actions): generates a random token, stores it in cache for `config('monitor.read_token_ttl_minutes')` minutes (default 15), and returns `{"success": true, "token": "...", "expires_at": "..."}`.
- The token returned by `issueReadToken` is accepted as a bearer **only for the `getData` action**. `clearData`, `updateBlockedIps`, `updateRules`, and `issueReadToken` itself always require the permanent `local_token` — a read token cannot mint another token or do anything beyond reading.
- **CORS**: routes under `monitor/*` carry their own dedicated CORS middleware (`MonitorCors`) — it does not read or depend on the host application's `config/cors.php`, since every client site has a different Laravel install. The allowed origin is `config('monitor.dashboard_origin')`, defaulting to `https://monitor.cantagalo.it` (no manual configuration required). Preflight `OPTIONS` requests get a `204` with the CORS headers attached.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance98

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.9% 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 ~19 days

Recently: every ~1 days

Total

15

Last Release

9d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/94250420?v=4)[Cantagalo](/maintainers/Cantagalo)[@cantagalo](https://github.com/cantagalo)

---

Top Contributors

[![DrCantagalo](https://avatars.githubusercontent.com/u/203075421?v=4)](https://github.com/DrCantagalo "DrCantagalo (29 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (6 commits)")

### Embed Badge

![Health badge](/badges/drcantagalo-laravel-monitor/health.svg)

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

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

593.1M9](/packages/open-telemetry-opentelemetry-auto-laravel)[nightowl/agent

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

915.8k](/packages/nightowl-agent)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)

PHPackages © 2026

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