stackmonitor/agent-laravel
StackMonitor Agent for Laravel: a lightweight package that connects your Laravel application to StackMonitor for monitoring and insights. Easy to install and configure, it reports runtime data from your app so you can keep an eye on performance and health in one place.
StackMonitor is a self-hosted Laravel monitoring agent that ships a report to a dashboard on a schedule. The PHP-upgrade additions are the first thing to look at, because they answer a question every team asks before a PHP bump: which code is going to fight us?
composer require the agent, then publish its config (php artisan vendor:publish --tag=stackmonitor-config or equivalent) and check config/stackmonitor.php for the report/schedule block..env, then php artisan config:cache so the new keys are picked up by queue workers too.dispatch the report job) and inspect the outgoing payload.
extra.php_code — the code-impact field introduced in v1.18.0.8.3.6-1ubuntu2.20) as its own value, separately from the bare version.extra.php_code before scheduling a PHP minor/major upgrade. It lists (a) your own app/ tree and (b) composer.lock packages that are not on packagist.org — i.e. your private/VCS/path-repository packages. Those are precisely the ones a composer update won't transparently replace.ondrej PPAs, distro php8.3-* packages), read the distro build suffix before acting on a PHP vulnerability alert. Distro builds routinely backport security fixes without bumping the version number, so the dashboard now downgrades PHP vulnerability findings to a hint on those builds rather than a warning.Only flip STACKMONITOR_AGENT_FILE_CONTENTS=true after the non-contents report looks sane; it is a separate, opt-in escalation.
Treat the report as a pre-upgrade gate, not just telemetry. Wire the report into your upgrade process: generate a report on the release branch, diff extra.php_code entries between 8.2 and 8.3 branches, and attach the package list to the upgrade PR. The fingerprint (path + size + mtime over each *.php) gives you a cheap "did anything in this private package change since we last signed off?" signal between releases.
Use the distro build suffix to triage PHP CVEs correctly. Since v1.21.0 the report tells you what the distribution's build adds on top of upstream (Ubuntu's -1ubuntu2.20, for example). The dashboard's behaviour follows directly from that:
8.3.6.Practically: a hint is a prompt to check apt changelog php8.3 / your distro's security tracker, not a green light. A warning on a self-compiled or official-Docker-image PHP deserves immediate attention. Encode that branch in your runbook so nobody treats "hint" as "safe".
Track the suffix, not just the version, across deploys. Because 8.3.6-1ubuntu2.19 → 8.3.6-1ubuntu2.20 is a real security change with an identical upstream version, diff the suffix between reports the same way you diff extra.php_code. A suffix bump on an apt upgrade is the signal that a previously-hinted CVE may now be patched — or that a new backport landed.
Understand the timeboxing, then design around it. Each report gets 2 seconds of file-listing budget. Packages that don't finish queue up and one of them gets a dedicated 20-second report later. Practical consequence: on a codebase with one huge private vendor package, expect the first report to be partial and to fill in over the following cycles. Don't build a dashboard tile that assumes completeness on report #1 — show "pending" instead of an empty list.
Lean on the 10-minute cache. The scan result is cached for 10 minutes, so it is safe to run the report more frequently than you'd otherwise dare (e.g. hourly or on every deploy) without re-walking the filesystem each time. Make sure the cache store backing this is a real shared store (redis, file, database) — not array, and not a per-request store. Under Octane or a multi-container deploy, an inconsistent cache means inconsistent reports.
Keep the contents flag for a narrow window. The STACKMONITOR_AGENT_FILE_CONTENTS=true path is best used deliberately: enable it, let the dashboard pull the ZIP for the one package you're auditing, then turn it off. That avoids an evergreen "source code egress" checkbox in your security review. Gate it per-environment: on in staging, off in production, unless your data policy has explicitly cleared sending PHP source to the dashboard host.
Order of operations for a rollout. Deploy the dashboard first, then the agent, then flip the flag. The report publishes php_code.contents as a capability marker; older dashboards that don't know the field will either ignore it or error on it. Same discipline for v1.21.0: a dashboard that doesn't understand the distro build suffix will at best ignore it and fall back to warning-on-everything, at worst mis-render the version string — so upgrade the dashboard before the agents.
php_code.contents before the agent starts emitting it. If you run the dashboard and agents from separate release trains, pin the dashboard version forward first. The v1.21.0 distro-suffix field follows the same rule.PHP_VERSION on Ubuntu is 8.3.6-1ubuntu2.20, not 8.3.6. Any monitoring, feature-gate or alerting code that does equality or version_compare against a bare semver will start behaving oddly once the suffix is surfaced. Compare the upstream portion separately from the build suffix.-1ubuntu2.x suffix by accident — or a custom build that mimics one — you'll get the softer hint. Verify against the actual package, not just the label.zip extension is a hard dependency for the contents path. Without ext-zip, the dashboard simply cannot fetch file contents — the report will honestly say contents are off. Check php -m | grep zip in the container image before you file a bug.resources/ tree can silently fall out of the forecast. Exclude generated PHP (compiled views, proxy classes, stubs) from your private packages, or split them.composer.lock scan. Your private test helpers and require-dev tooling won't be fingerprinted. This is fine for upgrade forecasting but means the report is not an inventory of everything in vendor/.composer install cleanly before an audit if you need certainty.php artisan cache:forget the relevant key, or just wait 10 minutes), then check whether the package's vendor folder contains a symlink, then check the file count against the 5000 cap. Those three account for nearly every "it's not showing up" report.STACKMONITOR_AGENT_FILE_CONTENTS is read from config; if you set it at runtime in .env without re-running config:cache (or without clearing it), the agent keeps the old value — so the dashboard sees contents: true while no ZIP is available, or vice versa.How can I help you explore Laravel packages today?