- Is shivas/versioning-bundle compatible with Laravel?
- No. shivas/versioning-bundle is a Symfony bundle, not a Laravel package. It registers through Symfony's Bundle, HttpKernel, and DependencyInjection conventions, and it ships no Laravel service provider, facade, or config stub. Laravel does not have the bundle and kernel machinery needed to auto-discover or boot it.
- Can I install shivas/versioning-bundle with Composer in a Laravel project?
- Composer may resolve the package, but it will not integrate with Laravel. There is no Laravel package discovery entry and no service provider to register the version service, Twig extension, or console command in a Laravel application. Forcing it in would require manually instantiating Symfony kernel internals, which is not a supported or sensible integration.
- How does shivas/versioning-bundle resolve the current application version?
- It resolves the running version from Git metadata, typically Git tags, and exposes the result through Symfony's container. The value is available to services, Twig templates, and a console command for diagnostics. The core idea is a semantic version string derived at runtime rather than a hand-maintained constant.
- Which Laravel versions does shivas/versioning-bundle support?
- None. The package targets Symfony and does not publish a Laravel support range. Symfony 8 support in version 4.2.0 implies PHP 8.4+ for that branch, but that constraint says nothing about Laravel compatibility. Treat any Laravel support claim as unsupported.
- How do I show the app version in Laravel Blade templates without this bundle?
- Set an APP_VERSION value in config/app.php from an environment variable at build or deploy time. Then read it with config('app.version') in Blade, or share it globally through a view composer. This gives the same display capability without a Symfony bundle.
- How do I create an app:version Artisan command in Laravel?
- Create a dedicated Artisan command, for example via php artisan make:command AppVersion, and return config('app.version'), the commit SHA, and build time as JSON or a table. Register it in the console kernel and call it in deployment or health checks. The command is a thin wrapper around build metadata you already control.
- Does shivas/versioning-bundle work in Docker or CI builds that do not include a .git directory?
- Often it does not resolve usefully. Version detection that depends on .git can fall back to dev-main or unknown when the artifact is built or deployed without repository metadata. Bake the version into an environment variable or generated file during CI so production containers do not need .git at runtime.
- What are the best alternatives to shivas/versioning-bundle for a Laravel application?
- For Laravel, the strongest alternative is a small native implementation: CI-populated config values, a /version or /health endpoint, and an app:version Artisan command. You can also evaluate Laravel-specific version or build-info packages if they expose config, routes, and commands cleanly. Avoid adopting Symfony bundles solely for a version string.
- How should I inject a Git tag, commit SHA, and build timestamp into a Laravel deployment?
- Have CI write APP_VERSION from the Git tag, APP_COMMIT from the short SHA, and APP_BUILD_TIME from the build clock into environment variables or a generated config file. Expose those values through a route and an Artisan command, and include the build ID in logs and exception context. This keeps the identifier immutable and queryable at runtime.
- Is shivas/versioning-bundle actively maintained and does Symfony 8 or PHP 8.4 support matter for Laravel?
- It appears maintained for Symfony, with support work such as Symfony 8 in version 4.2.0. That maintenance does not reduce Laravel risk, because Laravel is not a test target and the Symfony 8 branch can force PHP 8.4+ or transitive upgrades. For a Laravel stack, maintenance status is not enough reason to adopt it.