cboxdk / laravel-status-client
Cbox Status for Laravel: read a status page's public JSON with origin fallback, freshness and signed emergency notices, and show incident and maintenance banners in any app.
Requires
- php: ^8.4
- ext-sodium: *
- illuminate/cache: ^12.0 || ^13.0
- illuminate/console: ^12.0 || ^13.0
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/view: ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.14
- laravel/pint: ^1.32
- opis/json-schema: ^2.4
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^4.0 || ^5.0
- pestphp/pest-plugin-laravel: ^4.0 || ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Cbox Status for Laravel. Read a Cbox Status page's public JSON from any Laravel app, and show its active incidents, maintenance and emergency notices as banners in your own layout.
- Typed value objects for
current.json(contractcbox-status/v1) - The page's own origin first, then fallback mirrors
- Freshness from the heartbeat's age
- Ed25519 emergency notices, verified with libsodium against keys you configure
- A short cache with stale-if-error
<x-cbox-status::banner />for Blade,Status::shared()for InertiaFakeStatusandInteractsWithStatusfor your testsphp artisan status:check
It reads only public files. It has no API key and never talks to the Cbox Status control plane.
The contract is additive, so a page may use a status, state or impact this version does
not know yet. The client still reads that page: the value becomes Unknown (never
"operational"), and the raw string stays available, e.g. $component->statusValue.
Install
composer require cboxdk/laravel-status-client
CBOX_STATUS_PAGE=01m708vt2qwrtpzk61e80vaby8 CBOX_STATUS_URL=https://cbox.cboxstatus.com CBOX_STATUS_FALLBACKS=https://data.cboxstatus.com # Optional: public keys from the page's "Emergency keys" CBOX_STATUS_EMERGENCY_KEYS=
<x-cbox-status::banner />
Inertia::share('status', fn () => \Cbox\StatusClient\Facades\Status::shared());
$report = Status::report(); $report->available(); // a snapshot was read (now or from the cache) $report->stale; // the heartbeat is older than stale_after_seconds $report->indicator(); // ComponentStatus::Operational, … $report->activeIncidents(); // list<Incident> $report->emergency?->message; // a verified emergency notice
Testing
use Cbox\StatusClient\Snapshot\IncidentImpact; $this->fakeStatus()->withIncident('Sign-in is slow', IncidentImpact::Minor);
Documentation
docs/index.md. Start with the Quickstart.
Quality gate
composer qa # pint, phpstan (max), pest, license check, audit, SBOM drift
License
MIT. See LICENSE.md.