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

Laravel Hooks Laravel Package

alizharb/laravel-hooks

Laravel Hooks provides a simple action/filter system for Laravel apps, letting you register and run hooks to extend packages and application code without modifying the original source. Ideal for modular, maintainable customizations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for extensibility: Justifies building a plugin/hook system on top of Laravel rather than hand-rolling one. Dynamic ELOQUENT extensions (#[DynamicRelation], #[DynamicScope], Hook::model()) let you ship customer-specific or module-specific model behavior without forking core models — a strong argument against a multi-repo/per-tenant fork strategy.
  • Roadmap for platform/ecosystem features: The v1.2.0 "extensibility engine" framing directly enables roadmap items like third-party integrations, white-label/custom fields, marketplace add-ons, and modular product tiers.
  • Reliability risk mitigation: The Hook Circuit Breaker is a product-risk decision enabler — it makes it defensible to allow non-critical third-party listeners in request paths, which is often the blocker to shipping an open extension surface.
  • UX consistency decisions: @hook('name', 'fallback.view') lets you standardize empty-state and fallback rendering across themes without per-module special-casing — a design-system/product-consistency enabler.
  • Contract & API decisions: Type-safe DTO/interface hints in hook signatures make the extension API a stable, versionable contract — supporting decisions on API versioning, deprecation policy, and backward compatibility.
  • Modular architecture decisions: Zero-config laravel-modular discovery + the laravel-themer/modular-js suite lowers cost of a modular monolith vs. microservices — a real architecture bet for a PM weighing operational overhead.

When to Consider This Package

Adopt when:

  • You need tenant-, customer-, or module-specific behavior in shared Eloquent models without source modification or forks.
  • You run a modular monolith (or plan one) and want discoverable extension points with zero config.
  • You expose an extension surface to internal teams or third parties and need fault isolation (circuit breaker) and typed payloads.
  • You have Blade-driven UI that must degrade gracefully when no listeners/hooks are registered.
  • You want to defer microservices: hooks give you seams to extract later without rewriting call sites.

Look elsewhere when:

  • Your team is small and unlikely to maintain a public extension contract — the flexibility becomes undocumented implicit coupling.
  • You need guaranteed strong typing and compile-time guarantees; runtime hook resolution and dynamic model methods remain dynamically dispatched despite DTO hints.
  • Debuggability of "magic" is a hard requirement — runtime model extension and dynamic relations raise onboarding and tracing cost (mitigated by Pulse/Debugbar snapshots, not eliminated).
  • You require mature, long-term vendor support/SLA; single-maintainer ecosystem packages carry bus-factor risk.
  • Your extensibility needs are trivial (a few events/listeners) — native Laravel events and service container bindings suffice.

How to Pitch It (Stakeholders)

For executives: This release turns laravel-hooks from a convenience utility into a genuine extensibility platform. It lets us customize and extend product behavior per customer or module without forking core code, which reduces duplication and speeds up bespoke/enterprise deals. The new circuit breaker is the headline risk story: flaky third-party integrations get automatically muted instead of taking down critical paths — meaning we can safely open an extension surface to partners sooner. Net: faster customization velocity, lower maintenance cost, and a controlled blast radius.

For engineering: v1.2.0 delivers runtime Eloquent extension (attributes + fluent Hook::model()), a HasDynamicHooks trait, typed DTO hook payloads, Blade fallbacks with multi-line discovery, and zero-config modular discovery. CI is hardened (Pest on 8.3/8.4, PHPStan L5, Pint), which signals quality discipline. Trade-offs to plan for: dynamic dispatch and runtime metadata caching make debugging less obvious than static code — budget for observability (Pulse/Debugbar snapshots) and enforce typed hook signatures plus documented hook contracts. Adopt incrementally: start with Blade fallbacks and typed hooks, then layer dynamic model extensions behind feature flags, and treat the hook API as a versioned public contract before exposing it externally.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin