nicolasjourdan/business-logic-bundle
A PHP package for cleanly organizing business logic into reusable, testable components. It helps separate domain rules and workflows from controllers and framework code, making Laravel/PHP applications easier to maintain, extend, and test while keeping services lean.
MakeSpecification and MakeRule, extending generation beyond generic classes into two named domain patterns. This tips the decision toward buy/adopt rather than maintaining in-house stub files per repository — the cost of ownership is a Composer dependency instead of a shared internal package with its own release cycle.Rule class shape makes it feasible to expose rule configuration to admins later without a rewrite.Adopt when:
make:* commands daily.Look elsewhere or skip when:
Adoption hygiene: pin the version, verify the PHP/Laravel support matrix against your oldest supported app, and write a short ADR plus a convention doc — otherwise the generators produce classes nobody agrees on how to use.
For executives: This is a small, low-risk engineering dependency that standardizes how we write business rules and query logic. The 1.1.0 release adds generators for two patterns we care about — Specification (composable, reusable query/eligibility logic) and Rule (single, named, unit-testable business rules). The payoff is measurable in two places: less engineering time spent on boilerplate, and business logic that is individually testable and reviewable — which matters for pricing, entitlements, and eligibility logic where mistakes are expensive and audits are likely. There is no runtime dependency and no lock-in: generated classes are ordinary PHP we own outright, so reversing the decision costs almost nothing.
For engineering: 1.1.0 adds make:specification and make:rule alongside the existing makers. Use them to scaffold composable specifications for filtering/eligibility and discrete rule objects for business policy. Recommended rollout: adopt on one team for a sprint, standardize on the Specification pattern for a single subsystem (e.g., catalog filtering), then document the convention and expand. Pair the generators with tests from day one — the point of a Rule class is that it is independently assertable. Constraint to keep in mind: this generates structure, not behavior; do not let it be sold internally as a rules engine.
How can I help you explore Laravel packages today?