magdicom/laravel-hooks
A lightweight Laravel hooks package for registering and running actions and filters, making it easy to extend app behavior without editing core code. Useful for modular customization and package integration.
Architecture fit. Laravel Hooks is a thin Laravel wrapper over the magdicom/hooks core package. v2.0.0-beta.3 exposes the core beta.2 API through Laravel-native access paths: a helper, an optional facade, constructor injection, a hooks() accessor, and documented singleton lifecycle. The design intent is a lightweight extension/hook layer integrated into the service container rather than a standalone subsystem. This fits applications that want named extension points resolved through the container, and it fits least well in codebases already standardized on Laravel's event/dispatcher or pipeline primitives, where a second extensibility mechanism adds conceptual overlap.
Integration feasibility. Installation is a single Composer operation, but requires explicit beta stability flags on two packages simultaneously:
composer require magdicom/laravel-hooks:"^2.0@beta" magdicom/hooks:"^2.0@beta"
This is feasible for a spike or a pre-production branch. It is not feasible as a production dependency without an explicit risk acceptance, because both the wrapper and its core are prerelease and the wrapper's constraint is pinned to a specific core beta line.
Technical risk.
magdicom/hooks ^2.0.0-beta.2. Any core beta.3+ bump, or a core stable release that changes the constraint, forces a coordinated wrapper upgrade. Dependency resolution failures are the most likely day-one integration problem.Magdicom\Processors namespace move in this release is exactly the class of change that silently breaks imports.Key questions.
illuminate/support constrained narrowly enough to avoid conflicts in a mature dependency graph?processWith() / renderWith() via helper and facade extend to the remaining access paths (constructor injection, hooks()), or is coverage partial?Stack fit. Appropriate for Laravel applications that want container-resolved extension points with a small API. Poor fit for non-Laravel PHP services (the wrapper is the value; the core alone would be the dependency) and for teams unwilling to run prerelease code. No signal of framework-version breadth, so assume a narrow, recent-Laravel target until confirmed.
Migration path. Treat v1 → v2 as a greenfield integration rather than an upgrade. Recommended path: inventory every v1 touchpoint (helper calls, facade calls, injected contracts, registered hooks), map each to the v2 access path, and confirm the Magdicom\Processors namespace is reflected in all imports. Do not run v1 and v2 side by side in one application; the container bindings will collide.
Compatibility. The binding constraint is a two-package beta requirement. Before committing, run a composer require --dry-run against the real application lockfile to surface conflicts with anything else that depends on magdicom/hooks or on the same Laravel major. Version 2's break from v1 means any transitive dependency still on v1 pins the whole graph.
Sequencing.
hooks(), helper, and facade in the same container.Maintenance. Ongoing cost is tracking two packages with coupled version constraints and a demonstrated willingness to make breaking changes inside a beta line. Budget for a re-review at each core or wrapper release until v2 stabilizes, then a lower steady state. The internal adapter from the sequencing step converts each future core bump from an application-wide search-and-replace into a one-file change.
Support. A published documentation site and documented injection/lifecycle patterns are meaningful positives — most packages at this maturity stage have neither. The countervailing risk is concentration: a two-package, apparently small-maintainer ecosystem with no stated support commitment. Teams should expect self-support and should not depend on upstream responsiveness for production incidents.
Scaling. Hook resolution is container-mediated and expected to be cheap per dispatch, but this is unverified — no benchmarks accompany the release. The scalability question that matters more is state: singleton-scoped registration under concurrent or long-lived workers. Confirm registry state is reset or immutable per request before scaling out horizontally.
Failure modes. Watch for:
Magdicom\Processors move, producing class-not-found at boot rather than at call time.Ramp-up. Moderate for a Laravel developer: the helper and constructor injection paths are idiomatic and the documentation lowers the initial curve to hours. The real ramp-up cost is concentrated in operations and release engineering, not application code — specifically, teaching the team to treat the beta pin as a deliberate, reviewed decision rather than a version string, and to route all core interaction through the internal adapter so future breakage stays contained.
How can I help you explore Laravel packages today?