Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Plugin Hook Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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

  • Bus factor of one. Effectively a single-maintainer package inside a broader admin framework. If the upstream stalls, we own the code.
  • No visible release discipline. Semantic versioning, changelog, CI status, and test coverage all need to be confirmed before this touches a production path — assume none exist until proven otherwise.
  • Security surface. A hook system whose purpose is loading third-party callbacks is an execution surface by design. The package's own handling of plugin resolution, file inclusion, and callback validation needs review; the plugin management layer around it will need sandboxing and review gates regardless of what the package provides.
  • Determinism. Priority/ordering semantics, re-entrancy, and filter return-value contracts (a filter that returns null will silently null out the value) are the classic failure points in this pattern and must be specified, not discovered.
  • Framework drift. Laravel major-version compatibility is unverified; a package this size is unlikely to track Laravel 11/12 promptly.

Key questions to resolve before commitment

  1. Which PHP and Laravel versions are supported, and is there a compatibility matrix or CI evidence?
  2. Does it wrap Illuminate\Contracts\Events\Dispatcher or implement an independent registry? (Determines whether native listeners and hooks can interoperate.)
  3. Are hooks registered per-request or cached/compiled? What is the per-dispatch overhead?
  4. What is the plugin contract — manifest, autoload, activation/deactivation lifecycle, or just callbacks registered at boot?
  5. Are ordering, priority, and removal (removeAction) supported, and is there a documented return-type contract for filters?
  6. Is the repo a subtree/split of the CatchAdmin monorepo, and is it actively released?
  7. Is there any test suite, and what is the license/contribution posture beyond MIT?

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.

Integration Approach

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

  1. Compatibility and code review (blocking gate).
  2. Internal fork, pinned, with our own README and changelog.
  3. Adapter layer + documented hook naming convention.
  4. Pilot in a single non-critical module.
  5. Plugin author contract and review process defined.
  6. Broaden to remaining extension points only after pilot stability.

Operational Impact

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

  • Plugin throws or fatals → request failure in the host app unless dispatch is wrapped in try/catch with per-plugin fault isolation.
  • Filter returns wrong type → silent data corruption downstream; mitigate with typed wrappers around applyFilters.
  • Recursive or cyclic hook chains → stack exhaustion; needs a dispatch depth guard.
  • Nondeterministic ordering after a plugin add/remove → hard-to-reproduce behavior differences; needs deterministic priority tie-breaking.
  • Untrusted plugin upload → remote code execution; requires signed/reviewed plugin distribution, never runtime upload of arbitrary PHP.
  • Upstream abandonment or breaking change → mitigated by the fork and adapter layer.
  • Silent no-op if a hook name is misspelled → mitigate with a registry of known hook names asserted in tests.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums