Download the PHP package kefyusuf/laravel-bloom-gate without Composer

On this page you can find all versions of the php package kefyusuf/laravel-bloom-gate. 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-bloom-gate

Laravel Bloom Gate

Status: evaluation prerelease — v0.1.0-rc.2 is published on GitHub and Packagist; M6 is implementation-complete.

The first evaluation candidate's preparation is documented in the release readiness record. See the publication record for the first immutable tag and verified source revision. The rc.2 publication record records the latest candidate, seven-target release gate and registry installation.

M6 includes coordinated persistence, prepared writers, explicit adoption/recovery, online rebuild/abort, coordination diagnostics, and Laravel adapters/commands. See the final verification report, full local release matrix, final code review and post-fix checks, Laravel coordinated operation, coordination diagnostics and the M6 work-unit plan.

Laravel Bloom Gate is a production-safe probabilistic query gate for Laravel applications.

It can skip an authoritative existence lookup only when the runtime proves that a Bloom negative is safe to trust. A Bloom positive is never authoritative.

Why

A Bloom filter can answer:

Laravel Bloom Gate preserves the authoritative datastore as the source of truth:

The public exists() result is therefore authoritative-correct.

Design goals

Install and first filter

PHP 8.3+ and Laravel 12/13 are required. The following installation command targets the published v0.1.0-rc.2 candidate. Direct Packagist installation is verified. This remains an evaluation prerelease.

Create app/Bloom/CountryCodeFilter.php:

Add this entry to filters in config/bloom-gate.php:

Keep the Redis driver and configure Laravel's Redis connection. Run:

Application code can now call:

Without a qualified Redis trusted-negative profile, lookups still use the authoritative source. Declare BLOOM_GATE_REDIS_TRUSTED_NEGATIVE_PROFILE only after verifying the Redis deployment contract. The three-value immutable example demonstrates the lifecycle, not a performance benefit. Change semantic identities when their behavior changes. For mutable data, follow coordinated writing and recovery and include every membership-entry writer.

For SQL definitions, normalization must match the authoritative query's equality and collation rules. An exact-byte normalizer with a case-insensitive SQL lookup is unsafe: a differently cased value can exist in SQL while its Bloom bits are absent. Normalize both enumeration and query inputs consistently, or use an appropriate exact-comparison column/query. The package cannot infer this contract.

Optional shared descriptor hints (unreleased)

The development branch supports an optional APCu descriptor cache for the Redis driver. This feature is not included in the published v0.1.0-rc.2 tag. Enable it in config/bloom-gate.php after installing/enabling APCu for the PHP SAPI serving your application:

Use a unique namespace for each application, environment and Redis backend. The package also includes the application base path, Redis connection name and Bloom keyspace prefix in the cache namespace. Infrastructure settings are bound when services are resolved; restart long-lived workers after changing them. The default driver is none; Memory-backed filters do not use these hints.

A cold lookup resolves the descriptor before probing. A warm lookup performs one live atomic Redis probe. Only a cached control_state_changed result triggers one fresh resolution and probe; all other bypasses immediately use the authoritative source. No membership answers, application definitions or enabled decisions are cached. Current normalization/source/consistency identities are checked on every lookup. The TTL (1–86400 seconds) limits retention after the last successful descriptor resolution; warm reads do not extend it. TTL is not a safety freshness window: every lookup still validates live Redis state and bits. Missing/disabled APCu, invalid payloads, eviction or cache write failures use the normal resolver path.

APCu sharing depends on the SAPI and deployment. Separate containers or FPM masters may have separate caches; Windows uses a cache per process. Benchmark your deployment and hit/miss distribution. Fewer Redis calls do not guarantee lower latency than an inexpensive indexed SQL lookup. See the FPM verification record.

The development branch also executes Redis scripts by their SHA1 digest using EVALSHA. A missing server-side script triggers one EVAL to execute and cache the source. Subsequent calls use the digest again. Connection failures and Lua execution errors do not trigger this fallback. This applies to PhpRedis and Predis without additional configuration; the published rc.2 does not include it. Restricted Redis users must allow both EVALSHA and EVAL, as well as the commands used inside the scripts. An ACL denial does not trigger a retry. Verify these permissions before upgrading; keep the previous package version available if the deployment cannot grant them.

Current milestone

M6 — Online Rebuild and Write Coordination — implementation complete

The package is evaluating the published v0.1.0-rc.2 candidate. M6 adds coordinated prepared writes, explicit adoption, resumable online rebuild/abort, evidence-bound lease recovery, and read-only coordination diagnostics. Laravel exposes these capabilities through the facade and Artisan commands.

The rc.2 publication record verifies Redis with MySQL and PostgreSQL consumer commit/rollback and rebuild paths; SQLite remains a reference target. The bounded measurements demonstrate query avoidance without a latency speedup in the measured local workloads. MongoDB and production deployment acceptance remain unverified. No M7 feature scope is currently defined.

Query integration foundation

M5 — Safe Laravel Query Integration

M5 adds the application and Laravel integration required to turn the M4 lifecycle/control plane into a safe query gate:

Query-skip safety boundary

ACTIVE + HEALTHY is necessary but not sufficient to skip an authoritative lookup.

A trusted negative also requires, at minimum:

  1. query optimization enabled globally and for the filter;
  2. the current active generation to be the revision-pinned ACTIVE + HEALTHY generation;
  3. valid generation storage and the exact persisted layout;
  4. bound generation semantics;
  5. exact runtime/persisted equality for:
    • normalization fingerprint;
    • authoritative-set fingerprint;
    • consistency fingerprint;
  6. a safe authorized probe result;
  7. for Redis trusted negatives, explicit declaration of the supported production profile.

If any prerequisite is absent, stale, mismatched, corrupt, unavailable, or changed during the authorized probe, the optimization is bypassed and the authoritative source is queried.

Existing M3 generations without M5 semantic fingerprints are not corrupt. They remain valid low-level Bloom storage, but they are query-skip-ineligible until rebuilt/bound through the M5 managed workflow.

Explicit filter definitions

Each registered filter resolves a framework-neutral FilterDefinition:

Managed sizing is configured with:

The package derives the Bloom layout deterministically with the current M5 sizing policy rather than accepting an arbitrary runtime layout for managed builds.

Consistency contracts

immutable-v1

Use when membership does not change while the generation is active.

Managed synchronization writes are rejected.

preadd-v1

Use when the application can guarantee this ordering for every membership-entry write:

This avoids a committed authoritative-present row appearing before its Bloom bits.

Activation requires an explicit quiescent membership-entry window. During activation the package performs full candidate reconciliation, then fresh verification, then promotion.

Eloquent observers are not considered trusted-negative authority because they do not cover every possible write path.

Laravel-facing API

The facade delegates to the canonical Application services:

add() / addMany() are legacy preadd-v1 synchronization operations. Adopted coordinated filters fence those operations and use BloomGate::prepare() before the authoritative write, followed by an explicit commit/abort acknowledgement.

Validation adapters:

They delegate to QueryGate. They do not reimplement query correctness and do not claim Laravel native rule features such as ignore(), arbitrary where(), withoutTrashed(), or onlyTrashed().

Managed lifecycle commands

bloom:build creates a candidate only; it does not silently verify or activate.

bloom:activate always performs fresh verification before promotion. preadd-v1 additionally requires --quiescent and performs reconciliation under that window.

bloom:doctor is read-only preflight/diagnostics. It does not repair Redis configuration or mutate filter lifecycle.

Redis production support

M5 trusted-negative Redis support is intentionally narrow.

The recognized profile declaration is:

The production-safety contract requires the configured connection to remain:

bloom:doctor can verify these observable prerequisites at a point in time. It does not make them continuously true. Keeping the declared profile valid remains an operator responsibility.

Redis Sentinel and Redis Cluster runtime support are not M5 support claims. The keyspace remains same-slot/Cluster-aware by construction, but runtime support requires separate evidence.

Safety principles

  1. The authoritative datastore remains the source of truth.
  2. Bloom positives never authorize existence.
  3. ACTIVE + HEALTHY alone never authorizes query skipping.
  4. Semantic compatibility is generation-scoped and exact.
  5. Infrastructure uncertainty fails open to the authoritative lookup.
  6. Installation and command discovery do not contact Redis or scan authoritative data.
  7. Missing/corrupt managed Redis storage is never interpreted as a definite negative.
  8. Old unbound M3 generations are query-skip-ineligible, not automatically corrupt.
  9. Observer-based eventual synchronization is not trusted-negative authority.
  10. Coordinated writes require explicit adoption and durable PREPARED evidence before authoritative visibility; unknown outcomes retain active leases.
  11. CDC/outbox synchronization, Redis Sentinel, and Redis Cluster runtime support remain outside the implemented scope.

Architecture

See:

Requirements

Current verified anchors:

Predis operational-exception normalization is unit-tested, but real Predis runtime execution is not an official support claim.

Roadmap

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT.


All versions of laravel-bloom-gate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^12.0 || ^13.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/redis 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 kefyusuf/laravel-bloom-gate contains the following files

Loading the files please wait ...