Download the PHP package teksite/systeminfo-laravel without Composer
On this page you can find all versions of the php package teksite/systeminfo-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download teksite/systeminfo-laravel
More information about teksite/systeminfo-laravel
Files in teksite/systeminfo-laravel
Package systeminfo-laravel
Short Description Fast, secure system, server, PHP and Laravel runtime information for Laravel - with real-time metrics shaped for Chart.js.
License MIT
Informations about the package systeminfo-laravel
Teksite SystemInfo for Laravel
Fast, secure server, PHP and Laravel runtime information - plus real-time metrics shaped for Chart.js.
- Inventory: OS, kernel, CPU (model, sockets, cores, threads), GPU, disks, network interfaces, PHP (OPcache, JIT, Xdebug), Laravel (cache flags, drivers), database (version, size, latency).
- Live metrics: CPU % (total / per core / user / system / iowait / steal), load average, RAM, swap, per-disk usage, network and disk I/O throughput, container (cgroup) memory limit, uptime.
- Chart.js ready: every chart is
{labels, datasets}; a live update is the same structure with one point. - Fast: no process is spawned on Linux; Windows spawns PowerShell once per sample; results are cached and shared between concurrent callers.
- Secure by default: HTTP access is denied outside
localuntil you grant it; argv-only process execution; outbound calls are opt-in.
Linux and Windows are fully supported. Other platforms (macOS, BSD) get a safe fallback driver (load average, disks, PHP/Laravel data) instead of an exception.
Requirements
PHP 8.3+, Laravel 11 / 12 / 13, ext-mbstring. Nothing else: shell_exec is not needed (only proc_open, and only for GPU detection on Linux and for everything on Windows).
Installation
The service provider and the SystemInfo facade are auto-discovered.
Quick start
Live snapshot
Unavailable values are null, never a fake 0. A counter that went backwards (reset, wrap) yields null for that point - an honest gap in the chart instead of a spike.
HTTP API
Routes are registered under /system-info (configurable).
| Endpoint | Purpose |
|---|---|
GET /system-info/metrics |
One live snapshot. ?format=json (default) or ?format=chartjs, &labels=time\|iso\|ms |
GET /system-info/history |
Last N points, Chart.js-shaped. ?points=60, ?since=<epoch ms> for incremental polling |
GET /system-info/info |
Report. ?only=hardware,os, ?fresh=1. Limited to http.info_sections |
GET /system-info/stream-url |
Short-lived signed URL for the SSE stream |
GET /system-info/stream |
Server-Sent Events (signed URL only) |
Authorisation (read this before deploying)
Outside the local environment every request is rejected (403) until you configure one of:
Tokens are never accepted in the query string (they leak into logs and referrers). Endpoints are rate-limited (120/min per IP by default).
Chart.js
The payload for every endpoint with format=chartjs / history:
Polling (simplest, one cheap request per tick, works with any middleware/auth):
Server-Sent Events (push; EventSource cannot send headers, hence the signed URL):
SSE trade-off. Each open stream holds one PHP worker for up to
stream.max_duration(55 s), then ends cleanly so the browser reconnects. With a small PHP-FPM pool, or under Octane/Swoole, prefer polling. Many viewers share the same sample either way (see below).
For a time axis use ?labels=ms (epoch milliseconds) with a Chart.js date adapter, or ?labels=iso.
How it stays fast
| Concern | Approach |
|---|---|
| CPU %, network, disk I/O are rates | The previous raw sample lives in the cache. A request takes one new sample and diffs it - no sleep(). Only a cold cache pays one short (250 ms) window. |
| 50 dashboards polling | Callers within live.min_interval share one snapshot; computation is behind a lock with double-checked caching (no stampede). |
| Static data (CPU model, OS, GPU, ...) | Cached for cache.inventory_ttl (1 h). |
| Linux | /proc + /sys only. No fork/exec. A sample takes ~0.1 ms. |
| Windows | One PowerShell call per sample / one for the whole inventory (not ~10 per call). |
| History | Bounded ring buffer (history.points, default 300), written at most every history.resolution seconds. |
| Database size | Cached for cache.database_ttl (can be a heavy information_schema query). |
Use a shared cache store (Redis, Memcached, database, file). With the array store the previous sample cannot survive between requests, so each request pays the sampling window.
Windows note: a PowerShell start costs several hundred milliseconds. Keep polling intervals at 2-5 s there; Linux handles 1 s comfortably.
Security model
- Deny by default outside
local; see Authorisation. - No shell. Processes are launched from argv arrays (
proc_open, no/bin/sh), with a hard timeout and kill. PowerShell scripts go through-EncodedCommand. No user input ever reaches a command. - No hidden outbound traffic. Public IP lookup (third-party request) is off by default; when enabled it is HTTPS-only, has a timeout, never follows redirects and is cached.
- Minimal exposure. The
infoendpoint only revealshttp.info_sections(hardware,os,php,laravelby default). Network addresses, web-server banner and database name are opt-in. - SSE without cookies. The stream route authenticates with a signed, expiring URL and never starts a session, so a long request cannot overwrite session data.
- Tokens are compared with
hash_equals, are never read from the URL, and must be >= 16 characters.
Configuration
Publish config/system-info.php; every key is documented inline and every key is optional (nested options are deep-merged with defaults). Notable ones:
| Key | Default | Meaning |
|---|---|---|
http.enabled |
true |
Register the routes at all |
http.token / allowed_ips / allow_local |
null / [] / true |
Access control |
http.middleware |
[] |
Extra middleware, e.g. ['web', 'auth'] |
live.min_interval |
1.0 |
Seconds during which callers share a snapshot |
history.points x history.resolution |
300 x 2.0 |
10 minutes of history |
disk.paths |
null |
null = auto-detect local filesystems; or list paths explicitly |
network.exclude_interfaces |
docker/veth/lo/... | Globs ignored for throughput and local IP |
network.public_ip.enabled |
false |
Opt-in outbound lookup |
cache.store |
default store | Use a shared store in production |
Containers
Inside Docker/Kubernetes /proc still reports the host. The package therefore also reads the cgroup limit (v1 and v2): container.memory is the number that matters for OOM, and hardware.cpu.limit_cores shows the CPU quota. CPU % is host-wide.
Programmatic use of drivers
Repo\PhpInfo, Repo\LaravelInfo and Repo\DatabaseInfo keep their collect() methods.
Upgrading from 0.0.x
diskis now always a list of mounts andgpua list of GPUs.Repo\Linux*,Repo\Windows*,Concerns\WindowsPSandSafeExecutor::exec()were removed; use the drivers.- Public IP is no longer fetched unless
network.public_ip.enabledistrue. - Publish tag:
system-info-config(system-infostill works). composer.jsonno longer setsminimum-stability: dev.
Full list in CHANGELOG.md.
Limitations
- Windows GPU memory is under-reported above 4 GB (a Windows API limit); per-core CPU is not available on Windows; no load average.
- GPU live utilisation is not collected (inventory only).
- Inside containers, CPU % and network counters reflect the host unless the runtime isolates
/proc.
Testing
The core (drivers, calculator, history, chart formatter) is framework-independent and unit-tested against fixture /proc trees and a faked PowerShell; HTTP behaviour is covered with Orchestra Testbench.
Roadmap
Prometheus exposition endpoint, threshold alerts (webhook / notification), macOS driver, per-process top-N (opt-in), queue / Horizon health.
License
MIT (c) Teksite - [email protected] - https://teksite.net
All versions of systeminfo-laravel with dependencies
ext-json Version *
ext-mbstring Version *
ext-curl Version *
illuminate/cache Version ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0