answear/dpd-pl-pickup-services-bundle
PUDOListStreaming service reduces memory overhead for large datasets, a valuable feature for high-volume integrations.PUDOList) to Laravel’s service container (e.g., via bind() in AppServiceProvider).ConfigProvider) need rewiring.Http facade), so HTTP requests are native.PUDOList, PUDOListStreaming) must be manually registered in Laravel’s container (e.g., via bind() or a custom provider)..env or config/services.php.composer require answear/dpd-pl-pickup-services-bundle guzzlehttp/guzzle
AppServiceProvider:
public function register()
{
$this->app->bind(
\Answear\DpdPlPickupServicesBundle\Service\PUDOList::class,
function ($app) {
return new \Answear\DpdPlPickupServicesBundle\Service\PUDOList(
new \Answear\DpdPlPickupServicesBundle\Service\ConfigProvider([
'key' => env('DPD_API_KEY'),
'url' => 'https://mypudo.dpd.com.pl/api/pudo/',
])
);
}
);
}
.env:
DPD_API_KEY=xxxxxx
DPD_API_URL=https://mypudo.dpd.com.pl/api/pudo/
// config/dpd.php
return [
'key' => env('DPD_API_KEY'),
'url' => env('DPD_API_URL', 'https://mypudo.dpd.com.pl/api/pudo/'),
];
PUDOList into controllers/services:
use Answear\DpdPlPickupServicesBundle\Service\PUDOList;
public function __construct(private PUDOList $pudoList) {}
public function getPickupPoints()
{
return $this->pudoList->getAll();
}
Symfony\Component\HttpKernel\KernelInterface for HTTP handling. Workaround: Mock or replace with Laravel’s Http client.PUDOListStreaming service is memory-efficient but may require custom Laravel event listeners to process streamed data in real-time..env.Log::debug()) around API calls.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| DPD API downtime | Pickup points unavailable | Fallback to cached data + user alerts |
| Invalid API key | All requests fail | Validate key on startup + retry logic |
| High latency | Slow responses | Implement exponential backoff |
| Malformed API response | App crashes | Add response validation (e.g., JSON schema) |
| Symfony dependency conflicts | Integration breaks | Isolate bundle in a micro-service |
PUDO value objects (data structure).How can I help you explore Laravel packages today?