artisanpack-ui/hooks
WordPress-style actions and filters for Laravel with helper functions, Action and Filter facades, and Blade directives. Register callbacks on named hooks, run them in priority order, and remove them when needed.
applyFilters on price, title, summary, tax labels) let you satisfy "Client A wants prices formatted differently" and "Client B wants a different checkout summary" through configuration and small packages instead of forked codebases. This is a direct lever on support cost and release-velocity per client.order.placed and modules subscribe. This supports a roadmap where features can be added, removed, or feature-flagged per plan tier without touching the billing or checkout path.order.placed, user.registered, view.rendering give product/analytics/ops teams hook points for logging, notifications, and experiments that don't require core-team PRs.Consider it when:
Hooks interface or facade of your own, and be ready to fork. With zero stars, zero dependents, and a single-maintainer release cadence, that posture is non-negotiable.Look elsewhere when:
Pipeline already cover it. If you want async dispatch, queued listeners, retries, or per-event subscriber discovery, native events win out of the box; this package is synchronous and adds no queueing.'order.placed') mean typos fail silently at runtime and IDEs can't follow the call graph. If your team leans on static analysis, an interface- or enum-based approach is safer.Adoption shape I'd recommend: pilot in a non-critical path (admin rendering or notification hooks), instrument dispatch, and gate promotion to core paths (pricing, checkout) behind a proven track record on your own codebase.
For executives (one paragraph): We have a recurring cost: every client-specific or module-specific change to shared code requires branching or a core team PR, which slows releases and multiplies maintenance. This is a small, MIT-licensed library that gives us a standard way for modules and client packages to plug into our application without touching core files — the same extension model WordPress has used for two decades. Cost of adoption is low (a Composer dependency, a day or two of integration, roughly one engineer-week including tests and a fallback wrapper). The strategic upside is that it makes a plugin/add-on ecosystem and per-client white-labeling feasible, and it lets us sell customization without forking the product. The risk is that it's a young, single-maintainer package with no visible adoption; we mitigate that by pinning the version, hiding it behind our own internal interface so we can swap or fork it later, and piloting it on a non-critical surface first. Net: a cheap option on a capability we will need regardless, with a contained and reversible downside.
For engineering (the honest version): It's a thin, well-documented WordPress-style hooks system — addAction / doAction, addFilter / applyFilters, priority ordering (lower first, insertion order within a priority), removal APIs since 1.1.0, Action/Filter facades, and @action / @filter Blade directives. Auto-discovery means no config/app.php edits. It's PHP 8.2+, tested on Laravel 10/11, Pest test suite, Pint-formatted, and it ships Laravel Boost AI guidelines. What it does not give you: static typing on hook names, async/queued dispatch, tracing, or any community to answer questions. So: treat hook names as a public API and document them, wrap the helper functions in our own service so a future replacement is a one-file change, add a debug listener that logs every dispatch in non-production, and don't put it in a loop that runs per row. If we find we only need a couple of extension points, use Laravel events instead and skip the dependency.
How can I help you explore Laravel packages today?