frontastic/rulerz-bridge
Integrates the RulerZ rule engine with Frontastic, giving PHP applications a clean way to define and evaluate configurable business rules against objects and query builders. Ideal for promotions, eligibility checks, dynamic pricing, and other rule-driven logic.
customer.orders > 3 and customer.tier in ["gold","silver"]) and compiled to executable queries against arrays, Doctrine ORM/DBAL, or Elasticsearch. This package is only the Symfony DI wiring that registers compilers, operators, and the executor service. The product decision it informs is "do we want pricing/promotion/segmentation/eligibility logic stored as data and evaluated by an engine, instead of expressed as PHP conditionals?"symfony/expression-language (cheap, familiar, no DSL), glue OSS RulerZ into the stack (this package's role, zero license cost but real ownership cost), or buy a managed rules/flagging/decision service (SLA, authoring UI, audit — and a recurring fee). This package represents only the middle option and should be scored on total cost of ownership, not on price.Important framing correction: despite the "Laravel/PHP" label, this is a Symfony bridge, not a Laravel package. There is no Laravel service provider here. On a Laravel stack the realistic path is to adopt RulerZ core directly and write your own small service-provider binding — which means the decision is about RulerZ, and this repository is best treated as a reference implementation of the wiring pattern.
Consider it when all of the following hold:
composer.json against your runtime before it enters a roadmap.Look elsewhere, or plan to fork/wrap, when:
symfony/expression-language, config flags, or plain feature toggles will be cheaper to own and easier to reason about.To executives: This is a small, free, MIT-licensed adapter that lets a Symfony service run business rules — promotion eligibility, customer segments, merchandising and content targeting — as configuration rather than code, so a threshold or segment change does not require a deploy. The value is time-to-change for commercial policy, not the package. Be upfront on two caveats: it is Symfony-only (so on our Laravel services it would be RulerZ core plus our own wiring), and it has essentially no adoption or maintenance footprint, so we would own it outright rather than rely on a vendor. Recommendation: fund a time-boxed spike, treat the package as a reference implementation, and come back with a go/no-go on embedding a rules layer this quarter — choosing between an in-house wrapper around RulerZ (our default), plain expression language if the rules stay simple, or a managed rules platform if a business-user authoring UI becomes a requirement.
To engineering: This is Symfony DI glue over RulerZ — it registers rule compilers, operators, and the executor so services can apply the same DSL against Doctrine, arrays, or Elasticsearch. It is thin, readable, and MIT, so it is cheap to fork or replace with roughly a hundred lines of our own service provider. Treat it as a design input: copy the wiring pattern, pin exact versions and commit the lockfile, and verify PHP/Symfony constraints before it touches a production composer.json. Run the spike two ways — install the bridge, then hand-wire RulerZ core directly — and if the hand-wired version works in under a day, take core and drop the dependency. Either way, isolate everything behind our own RuleEngine interface and Rule value object so no domain code imports third-party classes, and land that interface plus a feature flag before any business rule moves into the DSL.
Non-negotiables if we adopt: a named internal owner, a fork/vendor path, rule versioning and validation at authoring time (not evaluation time), cached compiled rules, and dry-run/preview before activation — because the worst failure mode is a silent misclassification after a rule edit, which looks exactly like normal operation. The package gives us none of that; it is our obligation, not its feature set.
Ask: approve a short, time-boxed evaluation to confirm stack compatibility and measure the build-vs-glue delta. The deliverable is a decision, not a dependency.
How can I help you explore Laravel packages today?