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.
Recommendation: conditional adopt — small, low-cost, high-ecosystem-risk. The code surface is tiny and MIT-licensed, so the technical downside of trying it is low; the strategic downside is that you are re-implementing a capability Laravel already ships and taking a dependency on a package with effectively zero adoption (0 stars, 0 dependents, single maintainer).
Architecture fit
Illuminate\Events\Dispatcher. Laravel events already give you named events, listener registration, subscribers, queued listeners, wildcard listeners, and (via a custom dispatcher) priority. The package's genuine value-add over native events is the filter primitive — a value threaded through an ordered callback chain — which Laravel only approximates with Illuminate\Pipeline\Pipeline.addAction, doAction, applyFilters, …) are declared as global functions. In a large codebase this is a namespace-pollution and collision risk, and it hurts IDE/static-analysis discoverability compared to facades or injected services.Action and Filter are registered globally and are extremely generic names — meaningful collision risk with existing app facades, test helpers, or future framework additions.Integration feasibility
HooksServiceProvider, BladeDirectiveServiceProvider, and the two aliases. No config/app.php edits. A pilot can be stood up in under a day.artisan event:list; here a typo in a hook string is a silent no-op in production. Any adoption must be paired with an app-side naming convention, a constants/enum file for hook names, and tests asserting each documented hook has at least one listener.Technical risk
@filter(...) echoes the filter result directly. If a filter ever returns user-influenced content, the Blade directive bypasses {{ }} escaping. This is the highest-severity technical risk and needs a documented rule: only use @filter for trusted, developer-controlled output.removeAction/removeFilter compare callables, so anonymously-constructed closures (fn() => ... passed inline) cannot be removed later. 1.1.0 added removal APIs, but the ergonomics require holding a variable reference — a support-ticket generator.Key questions
Action/Filter alias names against our existing codebase?Stack fit
Migration path
Event::dispatch / listeners. Rewriting working event code to hooks buys nothing and loses queueing, wildcards, and event:list.HOOKS.md).App\Support\Hooks — that delegates to Action/Filter. This costs ~50 lines and makes a future swap to native events, Pipeline, or a fork a one-file change.Compatibility
config/app.php aliases and any class_alias usage.^1.2) and commit composer.lock; do not float.Sequencing
HOOKS.md, a test that asserts every declared hook has at least one listener, and a Pint rule set.Maintenance
Support
Scaling
Failure modes to plan for
@filter in Blade → mitigate with a written policy limiting @filter to trusted values.Ramp-up
How can I help you explore Laravel packages today?