shivas/versioning-bundle
Symfony bundle that simplifies application versioning by resolving the current version from Git, Composer, files, or environment variables and exposing it to services and Twig templates for display, cache busting, and release tracking.
Architecture fit — the decisive finding. Despite being catalogued alongside Laravel/PHP packages, shivas/versioning-bundle is a Symfony bundle, not a Laravel package. It ships a Bundle subclass and relies on Symfony's HttpKernel, DependencyInjection, and FrameworkBundle extension/config conventions for registration. Laravel consumes individual Symfony components (Console, HttpFoundation, Process, Finder) but does not ship the bundle/kernel/DI-extension machinery, so this package cannot be composer required and auto-discovered into a Laravel application. There is no Laravel service provider, no facade, no config stub. Any integration would require manually instantiating the bundle's internals against a kernel Laravel does not have.
What the package actually does — and what is portable. The valuable core is small: derive a version string from VCS metadata (Git tags / git describe), expose it via a service, a console command, and a Twig extension. Only the pattern transfers to Laravel; the code does not. The Twig extension is irrelevant to Blade, and the console command is a thin wrapper a TPM could spec in an afternoon.
Integration feasibility for a Laravel stack. Low, and not worth pursuing. A native Laravel implementation — bake APP_VERSION/commit SHA/build timestamp into config at CI build time, expose a /version or /health route, add an app:version Artisan command, and tag log/exception context with the build ID — is roughly half a day of engineering and removes a non-native dependency entirely. That implementation also solves the failure modes this bundle has (see below) rather than inheriting them.
Technical risk if forced onto a Laravel app:
.git dependency. Version resolution typically needs .git or an injected version file at runtime. Containerized and CI-built Laravel artifacts usually lack .git, producing a silent dev-main/unknown fallback in production — the exact moment the version string matters most.Key questions to resolve before any scoping:
composer.json, and does it still admit Symfony 6/7 or silently drop them?.git-less production container — env var, generated file, or build arg?TPM read: This is a build-vs-buy decision that lands firmly on build for a Laravel portfolio. The capability is real and worth having; the package is the wrong vehicle.
Stack fit. Mismatch. Treat this repository as reference material and prior art, not as a dependency. The transferable specification is: "every deployed artifact carries an immutable, machine-readable build identifier that is queryable at runtime and surfaces in diagnostics."
If the stack is Laravel (most likely case) — recommended path. Do not attempt installation. Implement the equivalent natively:
APP_VERSION (semver tag), APP_COMMIT (short SHA), and APP_BUILD_TIME into the release artifact's environment or a generated config file — sourced from the same immutable artifact that produced the image.config(), never through shelling out to git./version route returning JSON, folded into the existing /health endpoint if one exists.php artisan app:version command mirroring the bundle's console UX.If the stack is Symfony. Then this package is a reasonable fit: bump the constraint, resolve, clear cache, and verify the version service in staging both with and without .git present. Pin ^4.2 only in services already on Symfony 8; stay on 4.1.x until the surrounding dependency graph catches up, since the Symfony 8 ecosystem of compatible third-party bundles is still thin.
Migration path. None required. Nothing is installed, no prior integration exists, and no data migration is implied. If a Symfony service is onboarded later, 4.2.0 is a fine starting point provided PHP 8.4 is acceptable there.
Compatibility. The 4.2.0 release is a single compatibility-widening change (PR #101) with no API changes or deprecations — a maintenance-green signal for Symfony shops. It carries zero signal about Laravel compatibility, because Laravel is not part of the package's support matrix. Do not let the "PHP package" framing imply otherwise to stakeholders.
Sequencing.
/version response shape across services so observability tooling and support runbooks are uniform.Maintenance. Very low churn, real bus-factor risk. Single maintainer (shivas), small codebase, infrequent releases (4.1.2 → 4.2.0 is one PR). The code is small enough to fork or vendor if the maintainer disappears — but for a Laravel team, the native implementation eliminates this concern entirely rather than merely mitigating it. Recommend the native path partly because it converts an external dependency into ~100 lines the team owns and understands.
Support. No commercial support, no SLA, community-only via GitHub issues. Acceptable for a diagnostic convenience feature; unacceptable for anything on the critical path. Version exposure should never be a hard dependency of request handling — it should degrade gracefully.
Scaling. Effectively zero cost. Resolution happens once at container boot or on first service access; no per-request I/O beyond a possible one-time git describe subprocess. No scaling considerations in either the Symfony or the Laravel-native variant.
Failure modes to design around (applicable to both paths):
.git in production containers → version silently resolves to a fallback (dev-main/unknown). Mitigation: inject the version at build time; never rely on runtime VCS introspection in production.--depth=1) → tag-less resolution yields a degraded or wrong version. Mitigation: fetch-depth: 0 in the checkout step, or bypass VCS introspection entirely./version responses differ and support tooling breaks. Mitigation: define the response contract once, centrally.Ramp-up. Negligible for the package. For the recommended Laravel-native alternative, roughly half a day for an engineer familiar with the CI pipeline. The larger effort is organizational, not technical: agreeing on version semantics (semver vs. SHA vs. both) and getting every service to emit the same shape. That alignment work is the same regardless of which implementation is chosen — which is precisely why paying an integration tax for a Symfony bundle makes no sense here.
TPM recommendation. Do not adopt. The 4.2.0 release is a routine forward-compatibility bump (Symfony 8 support, PR #101) with no bearing on a Laravel stack, and the package's Symfony-kernel assumptions make it structurally unusable there. Capture the underlying requirement — immutable build traceability plus a /version or health endpoint — as a small internal task, standardize the response contract across services, and close out this evaluation. Revisit only if a Symfony 8 service enters the portfolio, in which case 4.2.0 becomes a low-risk, high-utility dependency for that service specifically.
How can I help you explore Laravel packages today?