apility/rule-builder
apility/rule-builder is a Laravel package for defining and evaluating dynamic rules through a fluent PHP API, making it easier to build flexible conditions, filters, and business logic without hardcoding each case.
if plan == 'pro' && seats > 10 && region in [...]) across controllers, jobs, and admin panels, this package gives you a single place to define, serialize, and evaluate rules. That is a real architectural decision with a long tail — every rule you hard-code becomes a ticket later.Reasonable fit when:
Look elsewhere when:
if statements behind a config flag don't need a dependency; the abstraction cost exceeds the benefit.To executives: This is a small, MIT-licensed PHP library that lets us define business rules as data instead of code. The strategic value isn't the library itself — it's that it lets us test whether "ops can change rules without an engineering ticket" is a capability worth investing in, for roughly a day of engineering time rather than a quarter. Treat it as a time-boxed experiment with a clear kill criterion, not a platform commitment.
To engineering: Low surface area, permissive license, easy to wrap behind our own RuleEvaluator interface so we can swap implementations (including a homegrown one) without touching call sites. Caveat up front: one star, zero dependents, single maintainer — we vendor or fork it, pin the version, and own the security review. The proposed spike is: define two real rules, evaluate them, and measure the effort to replace the dependency behind our interface. If replacement is trivial, the vendor risk is bounded and the experiment is worth running.
How can I help you explore Laravel packages today?