Download the PHP package pouya1364/probabilistic-laravel without Composer
On this page you can find all versions of the php package pouya1364/probabilistic-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pouya1364/probabilistic-laravel
More information about pouya1364/probabilistic-laravel
Files in pouya1364/probabilistic-laravel
Package probabilistic-laravel
Short Description Laravel package integration for probabilistic-php — Bloom Filter, Counting Bloom Filter, Cuckoo Filter, Count-Min Sketch, and HyperLogLog via the service container and a Facade.
License MIT
Informations about the package probabilistic-laravel
probabilistic-laravel
Laravel integration for pouya1364/probabilistic-php. Define named, pre-configured probabilistic data structures once in config, then resolve them anywhere in your app — the same pattern Laravel uses for cache stores, queue connections, and database connections.
Supported structures: Bloom Filter, Counting Bloom Filter, Cuckoo Filter, Count-Min Sketch, and HyperLogLog. See the core library for the algorithm documentation.
Requirements
- PHP 8.2+
- Laravel 10, 11, 12, or 13
Installation
The service provider and the Probabilistic facade are registered automatically via package auto-discovery — no manual registration needed.
Publish the config file:
This creates config/probabilistic.php.
Configuration
Each structure type holds any number of independently named instances, so a single app can size several filters differently for different purposes. Keys are written in snake_case.
| Group | Parameters |
|---|---|
bloom_filters |
expected_items (int), false_positive_rate (float) |
counting_bloom_filters |
expected_items (int), false_positive_rate (float) |
cuckoo_filters |
expected_items (int) |
count_min_sketches |
width (int), depth (int) |
hyperloglogs |
precision (int, default 14) |
Each instance is built once, on first access, and reused for the lifetime of the request.
Usage
Facade
Available accessors (each takes an optional instance name, defaulting to 'default'):
The facade exposes a @method static docblock for each accessor, so IDEs autocomplete the methods and their return types.
Without the facade
If you prefer not to use facades, resolve the manager from the container or inject it directly — both return the same singleton instance:
Listing configured instances
Prints a table of every configured instance and its parameters, grouped by structure type. Empty groups are omitted.
Related packages
- probabilistic-php — the core, framework-agnostic library with the algorithm documentation.
- probabilistic-bundle — the equivalent integration for Symfony.
Testing
License
MIT
All versions of probabilistic-laravel with dependencies
pouya1364/probabilistic-php Version ^0.1
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0