imanghafoori/laravel-decorator
Laravel Decorator lets you wrap method calls on any class with custom decorators, adding caching, logging, retries, or auth checks without editing the original code. Register a decorator once and every call to that class flows through it.
Class@method, invoke via a single call site). Relevant if your backlog contains "add observability/authz to N services" and you're weighing a platform-level solution against a small dependency.Decorator::call(...), so the decision is really "do we adopt a decorated-call convention for these services?" — which has a design/code-review cost, not just an install cost.Consider it when:
Look elsewhere when:
extend pattern, a proper AOP package, or explicit strategy injection instead.Class@method registration is a discoverability footgun.Executives: A small, free (MIT), single-purpose library that lets us add logging, caching, and access checks to existing business logic without rewriting it. Upside is faster delivery on observability/compliance items; downside is limited maintenance exposure from a low-adoption package. Recommended posture: pilot on one or two services, keep it vendored so we're never blocked, and don't make it load-bearing for anything critical.
Engineering: Lightweight decorator primitive for service-method calls — register decorators against Class@method and dispatch through the package's call site. It's not transparent AOP: adoption means a convention that decorated calls go through the facade, which we should document and lint. It complements, not replaces, HTTP middleware. The package is small enough to audit in an afternoon and fork if the maintainer goes quiet; the decision to make is whether the convention cost is worth removing duplication across our service layer.
How can I help you explore Laravel packages today?