kphoen/rulerz-bridge
Bridge package that brings the RulerZ rule engine to Laravel, letting you filter Eloquent models and collections with reusable rule strings. Define specifications once and apply them consistently across database queries and in-memory data.
Architecture fit — the framing is wrong, and that matters. The request classifies this as a Laravel/PHP package; kphoen/rulerz-bridge is a Symfony bundle. Its entire surface area is Symfony-specific glue: a bundle class, a DI extension, YAML/XML service definitions, and a config tree that registers the RulerZ engine and its compilers into Symfony's container. Laravel has no bundle concept, no bundle auto-discovery, and does not load Symfony DI extensions. Laravel ships Symfony components (Console, HttpFoundation, Finder) but not the FrameworkBundle or DependencyInjection wiring this package assumes. On a Laravel stack the bridge is dead weight — the "Laravel service provider and facade" claims in the description do not survive contact with the repository. This is the single most important finding and should gate everything downstream.
Integration feasibility — the capability is plausible; this package is not the vehicle. The dependency of actual interest is the core kphoen/rulerz engine: a specification-pattern rule evaluator with a small DSL that runs against arrays, Doctrine collections, or Elasticsearch. That core is viable in principle and framework-agnostic. The bridge contributes a few hundred lines of container wiring. Feasibility of "we want a business-rules DSL" is moderate. Feasibility of "we adopt this package in Laravel" is low. The core library is also effectively dormant across several years, which caps realistic PHP 8.x support regardless of what the bridge declares.
Technical risk — high, and concentrated in the wrong place. Signals are unambiguously negative: 2 stars, 0 dependents, opportunity score 35.5, overall score 0.62. Zero dependents means near-zero production validation — no informal bug reports, no Stack Overflow corpus, no community-tested edge cases. There is no visible security policy and no release cadence. The transitive chain (bridge → rulerz core → optional Doctrine/Elasticsearch adapters) inherits the same abandonment risk while multiplying audit surface. A dormant rule engine is not a low-risk dependency: rule evaluation is business logic, and silent behavioral drift in business logic is the expensive class of failure.
Key questions.
composer.json constraints against Laravel 10/11's PHP 8.1+ requirement before any commitment.Recommendation: No-go on adopting the bridge. Conditional-go on a timeboxed spike of the core library only if the business-rules use case is concrete and no better-maintained alternative wins the bake-off.
Stack fit — do not try to make the bundle fit Laravel. There is no clean adapter path. Porting the DI extension into a service provider means reimplementing the bridge, at which point we have written it and should own that reality rather than claiming we adopted a package. Treat the bundle as reference documentation for how someone else wired RulerZ into a container — nothing more.
Migration path — replace the bridge with ~50 lines of our own wiring. The integration surface is genuinely small: bind the RulerZ engine as a singleton, register compilers/operators as explicit bindings, and load configuration from config/rulerz.php. In Laravel that is one AppServiceProvider plus a config file. This removes a dormant dependency, keeps wiring visible and unit-testable, and leaves exactly one external dependency (rulerz core) instead of two. If we later conclude we don't need rulerz core at all, we've lost almost nothing.
Compatibility — expect friction and verify early. Audit composer.json constraints for PHP and Symfony version bounds; anticipate PHP 7.2–7.4 era declarations conflicting with Laravel's PHP 8.1+ floor and illuminate/* pins. Run composer why-not against our lockfile in the first day, not the last. Anticipate deprecation noise and possible Doctrine adapter incompatibilities if that path is pulled in. The most likely near-term failure is composer resolution blocking a host application upgrade — that risk lands on the whole framework upgrade roadmap, not just this feature.
Sequencing.
The critical sequencing note: the spike and the bake-off must complete before any commitment to the DSL. The DSL is a long-lived, developer-facing API and is far harder to reverse than a library choice.
Maintenance — plan for ownership, not consumption. With zero dependents and a dormant upstream, there is no realistic path where we consume updates. Budget roughly 0.25 FTE ongoing for the in-house adapter (dependency bumps, PHP upgrades, regression fixtures), rising sharply if we fork the core. This cost must be weighed against the entire justification for adopting a rule engine: if we are maintaining it anyway, the buy-vs-build math tilts toward a smaller bespoke evaluator or a maintained ExpressionLanguage.
Support — effectively zero. No vendor, no commercial backing, no support contract. Community support is a GitHub issue tracker with two stars' worth of traffic, which in practice means questions may go unanswered indefinitely. Institutional knowledge will be entirely internal, so documentation is not optional — it is the only support channel that will exist. Runbooks for rule authoring and debugging are a day-one deliverable, not a phase-two nice-to-have.
Scaling — CPU-bound and in-process, with caching as the primary lever. Evaluation runs per-request inside PHP-FPM workers; there is no separate service tier. Realistic ceilings depend almost entirely on compiled-rule caching — without it, rulesets recompile on every evaluation and latency scales with rule count and complexity. Plan a persistent cache keyed on a hash of rule definitions, and precompile at deploy rather than at runtime. Horizontal scaling is ordinary PHP-FPM autoscaling; no special topology required. Watch specifically for the failure mode where a growing ruleset quietly degrades p95 latency before anyone notices.
Failure modes — enumerate and instrument.
illuminate constraints, blocking host-app upgrades. Most likely near-term failure; can freeze the whole framework upgrade path.Ramp-up — non-trivial and commonly underestimated. The RulerZ DSL is idiosyncratic and lightly documented, and there is no tutorial ecosystem to lean on given near-zero adoption. Budget a mid-level PHP developer 1–2 sprints to reach productivity in the DSL and its debugging story, on top of the time to learn the specification pattern itself. That ramp cost is paid whether or not the package survives the evaluation, which is another argument for running the bake-off before committing the team to a specific DSL.
How can I help you explore Laravel packages today?