Kernel, Container, and EventDispatcher, which Laravel does not natively support.2gis/api-client, a PHP SDK for 2GIS. If the goal is API integration, the underlying SDK may still be usable in Laravel without the Symfony bundle, reducing coupling.ServiceProvider or bind()), making this bundle’s integration non-idiomatic.AppKernel in Laravel), which is anti-pattern and unscalable.DGisApiClient as a singleton).config() system, requiring custom logic.2gis/api-client SDK directly in Laravel, which would:
| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Framework Incompatibility | Critical | Avoid bundle; use SDK directly or port logic to Laravel. |
| Configuration Overhead | High | Abstract YAML params into Laravel’s config/services.php. |
| Dependency Bloat | Medium | Isolate Symfony-specific code (e.g., in a micro-service). |
| Maintenance Burden | High | Bundle is unmaintained (0 stars, no dependents). |
| API Versioning | Medium | Verify 2gis/api-client supports target API version. |
2gis/api-client directly in Laravel?laravel-2gis)?2gis/api-client directly in Laravel.
new \DGis\Api\Client($config)).Bundle in Laravel.
ServiceProvider to register the client as a singleton.spatie/laravel-config-array).ContainerAware interfaces.2gis/api-client via Composer.// app/Providers/AppServiceProvider.php
public function register()
{
$this->app->singleton(\DGis\Api\Client::class, function ($app) {
return new \DGis\Api\Client([
'key' => config('services.2gis.key'),
'secret' => config('services.2gis.secret'),
]);
});
}
config/services.php:
'2gis' => [
'key' => env('DGIS_API_KEY'),
'secret' => env('DGIS_API_SECRET'),
],
Illuminate\Cache or Illuminate\Events).2gis/api-client should work in Laravel without modification.parameters.yml → Laravel’s config() or .env.EventDispatcher → Laravel’s Event facade (requires mapping event classes).KernelTestCase → Laravel’s PHPUnit with Mockery or Pest.2gis/api-client independently.2gis/api-client docs or Laravel community.| Scenario | Bundle Risk | Direct SDK Risk |
|---|---|---|
| API Key Misconfiguration | Config parsing fails silently. | Clear env() or config() errors. |
| Dependency Conflicts | Symfony version mismatches. | None (pure PHP SDK). |
| Caching Issues | Symfony cache adapter required. | Use Laravel’s Cache facade. |
| Event Listener Failures | Symfony event system coupling. | Replace with Laravel events. |
| Upgrade Paths | Breaking changes in Symfony 5/6. | Only 2gis/api-client updates. |
AppKernel, ContainerAware)..env vs. parameters.yml).AppKernel and Laravel’s Kernel).How can I help you explore Laravel packages today?