gollumsf/controller-action-extractor-bundle
Symfony bundle for extracting the current controller and action from a request, making it easy to log, debug, or display which controller is handling each route. A lightweight helper for routing-aware applications.
Feature-level decisions (where this actually earns its keep):
Controller::method instead of raw URLs. This unlocks dashboards like "p95 latency by action" and "error rate on CheckoutController::submit" — far more stable than route strings, which change with URL structure.InvoiceController::void) rather than the HTTP path. Directly supports SOC 2 / GDPR access-log requirements and makes audit exports legible to non-engineers.Roadmap and investment decisions:
_controller request attribute and split it into class + method." In Symfony this is a ~20–40 line service over the framework's own ControllerResolver; in Laravel it's $request->route()->getActionName(). The package's entire value is that trivial normalization, plus edge-case handling for invokable controllers, Class::method strings, and closures.Adopt only if all of these hold:
...-bundle, GollumSF namespace, Symfony DI/service wiring). It will not drop into a Laravel app.Request internals (see below), it is a per-minor-version upgrade obligation, not a drop-in.Look elsewhere (or build in-house) when:
Risk notes from v2.0.2 (patch, no breaking changes, no new features):
Request::$attributes — a property with hooks since Symfony 8.1 — could no longer be assigned on a PHPUnit double. Any library that has to mock or mutate Request::$attributes sits directly on framework internals; Symfony minor releases can break it silently. That is precisely the class of breakage we would rather discover in our own tests than in a third party's release cadence.SYMFONY_REQUIRE); until this release, the symfony_* jobs installed the latest components rather than the targeted branch. So earlier compatibility guarantees were effectively untested. The new pinning is a genuine improvement, but it means the package's track record should be read from this release forward.Bottom line: this is a micro-utility, not a platform. Still treat it as a reference implementation to read for five minutes, then write the 30 lines yourself.
For executives: This is a small, single-purpose library that identifies which controller and method handled a request. Its strategic value is as an enabler of observability, audit logging, and entitlement checks — not as a product in itself. Recommendation: do not adopt as a dependency. It's GPL-3.0 licensed, has essentially no adoption (1 star, 0 dependent projects, single maintainer), and replicates functionality our framework already provides. Adopting it would add legal review, supply-chain risk, and a long-term maintenance obligation in exchange for code we can write in under an hour. The new v2.0.2 release is a maintenance patch — Symfony 8.1 support plus CI and mock fixes — which shows the maintainer is active but does not change any of the underlying economics; if anything, the fact that a framework minor required a patch illustrates the ongoing upgrade tax we would be signing up for.
For engineering: We need a stable Controller::method identifier for logs, metrics, audit records, and permission mapping. Rather than depend on gollumsf/controller-action-extractor-bundle, implement a thin resolver over the framework's native controller resolution:
ControllerResolver, handle Class::method, invokable controllers, and closures explicitly.Cover it with unit tests for invokable controllers, service-configured controllers, and closure routes — these are exactly the cases a small third-party bundle would get wrong silently. Budget roughly a half-day including tests, and we own the abstraction, the license, and the edge cases. Note one concrete lesson from v2.0.2: avoid assigning Request::$attributes on test doubles — with Symfony 8.1 that property uses hooks and is no longer writable on a PHPUnit mock, so build our resolver to read the resolved action rather than mutate request state. If someone wants to prototype with the bundle (v2.0.2 is Symfony 8.1-compatible) to sanity-check the API surface, that's fine — read it, don't ship it.
How can I help you explore Laravel packages today?