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

Before After Bundle Laravel Package

expertcoder/before-after-bundle

A Symfony 2/3 bundle that runs code before every action in a controller. Implement ExecuteBeforeInterface on your controller and put logic in executeBefore() to execute automatically before any action method is invoked.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: poor, and mismatched to the stated target stack. Despite being filed under a "Laravel/PHP package" review request, expertcoder/before-after-bundle is a Symfony 2/3 bundle, not a Laravel package. It integrates via AppKernel::registerBundles() and hooks into Symfony\Component\HttpKernel\Event\FilterControllerEvent — both constructs that have no counterpart in Laravel's bootstrap or HTTP kernel. There is no service provider, no facade, no config publish, and no Laravel-compatible autoloading story. From a TPM standpoint, the first decision is not "how do we integrate this" but "is the requested pattern portable at all," and the answer is that only the concept is portable, not the code.

Integration feasibility: low as a dependency; moderate as a design reference. composer require expertcoder/before-after-bundle will almost certainly fail dependency resolution in any modern Laravel application. Laravel 9+ requires symfony/http-kernel ^6.0 (Laravel 11/12 require ^7.0), while this bundle targets Symfony 2/3 and the long-removed FilterControllerEvent. FilterControllerEvent was deprecated in Symfony 4.1 and removed in Symfony 5.0, so even a Symfony shop cannot use this bundle without being pinned to an EOL major. The only realistic path is to reimplement the behavior natively in Laravel — HTTP middleware for cross-cutting before/after logic, controller traits or route middleware for per-controller behavior, and framework events (RouteMatched, RequestHandled, terminable middleware) for the hook points.

Technical risk: high, concentrated in abandonment rather than functionality. The repository is archived, scored 0.02, has 2 stars, 0 dependents, and a maturity level of "readme" — no evidence of a test suite, CI, changelog, or tagged release discipline. The README's own TODO states executeAfter is unimplemented, meaning the package delivers roughly half its name. Archived plus zero dependents means no downstream pressure to fix anything and no community-vetted usage patterns. Adopting the code introduces a permanent fork obligation for a capability that Laravel provides out of the box.

Key questions for the requester:

  • Is the actual requirement "run logic before/after controller actions," or is it a specific audit/logging/feature-flag need that a named middleware would satisfy more precisely?
  • Is the target codebase genuinely Laravel, or is there a legacy Symfony 2/3 service still in the estate? If the latter, the migration conversation is to KernelEvents::CONTROLLER event subscribers, not to this bundle.
  • Who owns the fork if we vendor it, and what is the acceptable maximum age of an unmaintained dependency in our supply chain policy?
  • Does the before-hook need to be able to short-circuit the request (auth, rate limiting)? The package's executeBefore() returns void in the example and gives no documented short-circuit semantics — that ambiguity alone is a blocker for security-adjacent use cases.

Integration Approach

Stack fit: none for Laravel; legacy-only for Symfony. On Laravel 10–12 / PHP 8.2+, the package cannot be installed and should not be. On Symfony 4+, the bundle is dead code. On Symfony 2.3–3.4, it fits — but those branches have been EOL since 2018 (2.x) and 2021 (3.4), so that fit is not a viable production target.

Migration path: translate the pattern, then retire the dependency. The recommended sequence is to treat this repository as documentation of an idiom rather than an artifact to ship:

  1. Codify the requirement. Identify each controller/action that needs before or after behavior and write down the ordering, short-circuit, and error-handling expectations the README leaves unspecified.
  2. Map to native primitives. Global or group middleware for cross-cutting before/after with clean termination semantics (terminate() for post-response work); route-level middleware for per-controller scope; Illuminate\Routing\Events\RouteMatched if action-level dispatch is needed.
  3. For a Symfony shop, use an EventSubscriber on KernelEvents::CONTROLLER (before) and KernelEvents::RESPONSE or kernel.terminate (after). This is the direct successor to FilterControllerEvent and is supported on all maintained versions.
  4. Do not vendor or fork unless a hard, documented blocker exists — the cost/benefit does not survive review.

Compatibility: PHP version constraints in the composer manifest will be pinned to a PHP 5.x/7.0-era range, clashing with PHP 8.x requirements in Laravel and modern Symfony. Laravel's own symfony/* transitive dependencies will conflict directly. There is no path to a clean composer update graph.

Sequencing: discovery spike (1 day) → design of the native equivalent (2–3 days) → implementation with tests (3–5 days) → remove the package from consideration and document the decision. Total effort is small enough that forking the bundle is strictly more expensive than reimplementing the behavior.

Operational Impact

Maintenance: Total. Archived status means security patches, PHP 8.x compatibility fixes, and Symfony version bumps will never arrive. Any fork becomes an internal product with an internal owner, and its blast radius spans every controller that implements the interface — a wide, shallow coupling that is easy to forget during refactors.

Support: Effectively zero. A single-author archived repository with two stars and no dependents gives no community backchannel, no issue triage, and no upgrade guidance. Internal engineers unfamiliar with the pattern will search for a package that no longer resolves in Composer and lose time on the dead end.

Scaling: Runtime cost is negligible — one extra method call per action. The scaling concern is architectural: implicit per-controller before hooks create invisible control flow that compounds as the controller count grows, and the absence of an executeAfter implementation forces teams to hand-roll cleanup, telemetry, and transaction commit logic in inconsistent places. A single well-named middleware stack scales far better cognitively than N controllers each implementing an interface.

Failure modes:

  • Silent non-execution. If a developer forgets implements ExecuteBeforeInterface, the hook simply does not run — no error, no log. For audit or authorization logic this is a correctness and compliance defect, not a nuisance.
  • Ordering ambiguity. No documented precedence among multiple hooks or relative to framework-level listeners.
  • Exception semantics undefined. Behavior when executeBefore() throws is unspecified; requests may hang or return unhandled 500s.
  • Half-feature trap. Teams will assume executeAfter exists because of the package name and discover the TODO only after designing around it.
  • EOL runtime exposure. Any environment capable of running this bundle is out of security support, which dominates all other risk in a compliance review.

Ramp-up: The concept takes minutes to explain — hence the temptation. That low learning curve is precisely the hazard: a trivially graspable but unmaintained pattern can propagate through a controller layer before anyone notices the dependency is archived. Recommendation: reject as a dependency, adopt the pattern natively via Laravel middleware (or Symfony event subscribers), and record the decision so the same request does not resurface at the next package audit.

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.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle