Weave Code
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
Symfony Consul Bundle

Symfony Consul Bundle Laravel Package

akondas/symfony-consul-bundle

View on GitHub
Deep Wiki
Context7

Auto register Symfony app with Consul

Frequently asked questions about Symfony Consul Bundle
Can I use Symfony Consul Bundle directly in a Laravel project without Symfony?
No, this bundle is designed for Symfony and requires Symfony’s kernel and console components. However, you can integrate it into Laravel by installing `symfony/console` and `symfony/framework-bundle` as dependencies, then wrapping commands in Laravel’s Artisan facade or creating a service provider to bridge the gap.
What Laravel versions are compatible with this bundle?
The bundle itself doesn’t natively support Laravel, but you can use it with Laravel 8.0+ by installing Symfony’s console package (`symfony/console`) and abstracting its commands. Laravel 10.x with PHP 8.1+ is the most stable target stack for integration.
How do I configure Consul registration in Laravel using this bundle?
Since Laravel uses `.env` instead of Symfony’s YAML config, create a `config/consul.php` file to map Symfony’s expected settings. Use a Laravel service provider to load these values and pass them to the bundle’s `ConsulService` class during registration.
Does this bundle support Consul health checks and dynamic configuration?
Yes, the bundle includes commands like `debug:consul-check` to verify health checks. Dynamic configuration is supported via Consul’s KV store, but you’ll need to manually integrate it with Laravel’s config system using the underlying `sensiolabs/consul-php-sdk`.
What’s the best way to handle deregistration during Laravel app shutdown?
You can trigger deregistration via a Laravel event listener (e.g., `terminating`) or a custom Artisan command called during deployment. For Kubernetes, use a pre-stop hook to call `php artisan consul:deregister` before pod termination.
Are there conflicts with existing Laravel Consul packages like spatie/laravel-consul?
Yes, this bundle relies on `sensiolabs/consul-php-sdk` (v3.1), while `spatie/laravel-consul` may use a different SDK version or approach. Avoid mixing them; instead, choose one and extend it for Laravel-specific needs or fork the bundle for compatibility.
How do I handle Consul API changes or SDK deprecations in Laravel?
The bundle uses an older SDK version (v3.1). To mitigate risks, pin `sensiolabs/consul-php-sdk` to `^4.0` in your `composer.json` or fork the bundle to update dependencies. Test API compatibility by checking Consul’s HTTP API docs for breaking changes.
Can I use this bundle in a polyglot microservices environment with Symfony and Laravel?
Yes, this bundle is ideal for polyglot setups. Deploy it in Symfony services and use a Laravel wrapper (e.g., a custom Artisan command) to register/deregister Laravel services. Ensure consistent Consul client configurations across both frameworks.
What’s the failure recovery strategy if Consul registration fails during deployment?
Implement retry logic in your Laravel service provider or deployment script (e.g., using `do` loops with exponential backoff). Log failures to a monitoring system like Sentry or Prometheus. For critical services, fail the deployment if registration persists beyond a threshold.
Are there alternatives to this bundle for Laravel service discovery?
Yes, consider `spatie/laravel-consul` for native Laravel support or `laravel-discovery` for generic service registration. For Kubernetes-native setups, use `kubernetes/client` with Consul sidecars. Evaluate alternatives based on your need for Symfony interoperability vs. Laravel-specific features.
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.
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge