catchadmin/plugin-hook
A lightweight hook system for CatchAdmin that lets plugins register and listen for events, so you can extend core behaviour without patching framework code. Useful for inserting custom logic at defined extension points in a Laravel-based admin panel.
Architecture fit
catchadmin/plugin-hook is a WordPress-style action/filter hook layer for Laravel, published as a companion to the CatchAdmin admin framework. Architecturally it sits beside Laravel's native event system rather than replacing it: a service provider bootstraps a global hook registry, and extension points are exposed as addAction/doAction and addFilter/applyFilters-style calls. That model is well understood and is a genuine fit if the product requirement is third-party extensibility without forking core — plugin authors register callbacks against named extension points, core code stays untouched. It is a weaker fit if the actual need is internal decoupling, where Laravel's Event/Listener dispatcher plus Pipeline already covers the ground with first-party support and no added dependency.
The main architectural question is overlap. Running a second dispatch mechanism alongside Laravel's dispatcher creates two ways to do the same thing, which tends to produce inconsistency as the codebase grows. If adopted, it should be an explicit, documented boundary: hooks for external plugin surfaces only, native events everywhere else.
Integration feasibility Low technical friction to try: standard Composer install, package auto-discovery on Laravel 5.5+, a facade/alias, and no database or queue requirements implied. The API surface is small, so a spike is a day or two of work. The real feasibility constraint is not installation — it is the absence of any verification signal. Zero stars, zero dependents, and a zero composite score mean there is no evidence of production use, no ecosystem of plugin packages to validate the contract, and no community pressure to keep the API stable.
Technical risk
null will silently null out the value) are the classic failure points in this pattern and must be specified, not discovered.Key questions to resolve before commitment
Illuminate\Contracts\Events\Dispatcher or implement an independent registry? (Determines whether native listeners and hooks can interoperate.)removeAction) supported, and is there a documented return-type contract for filters?Verdict: viable as a reference implementation or as a vendored fork for a CatchAdmin-based build; not advisable as an unpinned upstream dependency in a system with real availability or security requirements.
Stack fit
Strongest fit is a Laravel application already on CatchAdmin, where the hook layer is the framework's native extension idiom and plugin packages will expect it. On a vanilla Laravel codebase the fit is conditional: adopt only if third-party plugin distribution is a product requirement, not merely for internal modularity — otherwise use native events plus a module loader such as nwidart/laravel-modules.
Migration path
Do not adopt directly on main. Sequence: (1) run a time-boxed spike on a branch, exercising priority ordering, filter chaining, and removal; (2) if it holds, fork to an internal namespace, pin the version, and vendor it; (3) place an internal adapter/facade in front of it so call sites depend on our interface, not the package's, giving a clean swap to native events later; (4) pilot in one low-risk extension point before opening it to plugin authors.
Compatibility
Confirm PHP/Laravel constraints against our runtime before anything else; check for facade alias collisions with existing packages and for conflict with any other hook or module system already present. Because catchadmin/plugin-hook is designed as part of a framework, expect implicit coupling to CatchAdmin conventions (plugin directory layout, admin controllers, config keys) — verify how much of that comes along with the dependency.
Sequencing
Maintenance Assume we become the maintainers. Budget for periodic Laravel-upgrade patching, a security review of callback loading, and ownership of the plugin-facing API contract. The dependency is small enough that forking is cheap; the cost is not code, it is the commitment to keep the extension contract stable for third-party authors once published.
Support No community, no vendor SLA, likely documentation in Chinese and scoped to CatchAdmin usage. Internal documentation and a written hook contract are mandatory, not optional. Escalation path is "read the source," so keep the fork small and readable.
Scaling Hook dispatch is in-process and synchronous, so cost scales with the number of registered callbacks on hot paths and with plugin code quality, not with request volume per se. Practical controls: forbid hooks in tight loops and high-QPS endpoints, cache/compile the registry where supported, cap the number of registered callbacks, and instrument dispatch duration so a slow plugin is attributable. Plugin code runs in the request lifecycle — there is no isolation boundary — so a heavy plugin degrades the whole application.
Failure modes
applyFilters.Ramp-up The API mirrors WordPress conventions, so engineers with WP or Drupal experience are productive in hours; everyone else needs roughly 1–2 days plus the internal contract doc. The larger ramp is organizational: establishing plugin review, versioning, and deprecation policy for external authors — that is a process investment measured in weeks, and it should be staffed before the first third-party plugin ships.
How can I help you explore Laravel packages today?