Download the PHP package evolvex/laravel-invariant-sentinel without Composer

On this page you can find all versions of the php package evolvex/laravel-invariant-sentinel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-invariant-sentinel

Laravel Invariant Sentinel

Continuous runtime verification of business invariants for Laravel 12 / 13.

Sentinel answers a different question from static analysis and request monitoring:

The request succeeded — but is the resulting business state actually valid?

A completed withdrawal may have a successful provider execution while its wallet debit is missing. Sentinel detects the broken runtime business state, records evidence, opens a deduplicated incident, retries within eventual-consistency windows, and automatically resolves the incident when the invariant becomes healthy again.

Requirements

Install

Register invariants explicitly in config/sentinel.php:

or at application boot:

A production invariant

A check returns semantic status and evidence:

Status semantics

Sentinel deliberately does not model evaluations as boolean values.

Status Meaning
pass Invariant is proven healthy
fail Invariant is proven violated
deferred Currently inconsistent but still inside the allowed consistency window
unknown Truth cannot currently be established
error Sentinel/check execution failed; this is not a business violation
not_applicable The invariant does not apply to the resolved subject

This distinction prevents transient replication lag, delayed jobs, or unavailable external facts from becoming false critical incidents.

Durable trigger path

Triggers do not execute heavy checks in the HTTP path. They create/coalesce a record in sentinel_pending_checks and dispatch a drain job after commit. Multiple events for the same invariant + tenant + subject collapse into one pending check.

For production, run a worker for the Sentinel queue:

The durable table is the source of pending work; the queue message is merely a wake-up mechanism. If queue dispatch fails, Sentinel reports the error but leaves the durable pending row intact. A periodic sentinel:drain is therefore recommended as recovery protection.

Anti-entropy sweeps

Events can be lost, code paths can forget to dispatch them, and deployments can interrupt work. Critical correctness must have a second discovery path.

Recommended scheduler (or set sentinel.scheduler.enabled=true and use SweepTrigger definitions):

For very large datasets, implement ViolationFindingInvariant and return only subjects selected by a set-based violation query instead of hydrating every model.

Fact store

Cross-system facts can be recorded idempotently:

Checks can then use $context->facts without making live provider requests during a sweep.

Incident lifecycle

Sentinel stores three separate concepts:

Flapping is controlled by IncidentPolicy (openAfterFailures, resolveAfterPasses). Incident fingerprints exclude changing actual values, so actual=0 becoming actual=2 does not create a new incident for the same broken rule.

CLI

Safe remediation

Automatic repair is disabled by default. A remediable invariant implements RemediableInvariant and supplies a Remediation that first produces a deterministic RemediationPlan. The CLI is dry-run by default and requires both configuration enablement and explicit --execute plus confirmation.

Sentinel should never blindly convert missing debit into Wallet::debit(). Ambiguous remote operations must be reconciled before any irreversible repair.

Dashboard

Enable the optional read-only dashboard:

Then visit /sentinel. The default middleware is web, auth, and can:viewSentinel; define the viewSentinel gate in the host application before enabling the dashboard.

Multi-tenancy

Replace the default global tenant resolver:

Tenant identity is included in state, pending-work and evaluation lock keys to prevent cross-tenant coalescing.

Context propagation

The default context adapter captures known Laravel Context keys when available:

You may bind ContextResolver to integrate a dedicated context propagation package.

Security and evidence

Evidence is recursively redacted according to sentinel.evidence.redact. Do not store secrets or raw card data as evidence. Dashboard authentication and authorization must be configured by the host application.

Database constraints still win

Sentinel is not a replacement for:

If a rule can be guaranteed transactionally by the database, enforce it there. Sentinel is for cross-table, aggregate, eventual, legacy and cross-system correctness that cannot be represented safely as a local database constraint.

Testing

For real evaluation tests, either use the facade directly or the included InvariantTest harness:

Facade form:

Run package tests:

Production checklist

Run:

For multi-node production use a shared lock-capable cache (typically Redis), a durable queue, periodic sentinel:sweep, periodic sentinel:drain, evidence retention/pruning, and explicit authentication around the dashboard.

Architecture

License

MIT.


All versions of laravel-invariant-sentinel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/bus Version ^12.0|^13.0
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package evolvex/laravel-invariant-sentinel contains the following files

Loading the files please wait ...