answear/inpost-pickup-point-bundle
Symfony bundle for integrating with InPost ShipX pickup points. Install via Composer, then use FindPoints and FindPointsRequestBuilder to search parcel machines by name, type, functions, location (postcode/city/province), partner, availability flags, and pagination.
HttpClient, Serializer).symfony/http-client-bridge) for minimal overhead.guzzlehttp/guzzle, symfony/serializer) if needed.Illuminate\Http\Client) for consistency.PickupPointFound) for reactive workflows (e.g., notifications, analytics).HttpClient → Laravel’s HttpClient).config/services.php.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency | Medium | Use Laravel’s Symfony Bridge or vendor components. |
| API Rate Limits | Medium | Implement caching (Redis) and retry logic. |
| PHP 8.4+ Requirement | Low | Laravel 10+ already meets this. |
| No Write Operations | High | Accept limitation or supplement with direct API calls. |
| Undocumented Edge Cases | Medium | Add integration tests for error scenarios. |
Symfony vs. Laravel Compatibility:
Answear\InpostBundle\Client with Laravel’s HttpClient without breaking functionality?Serializer) that require workarounds?Authentication:
HttpClient?Performance:
setPage, setPerPage) scale for bulk operations (e.g., 1000+ points)?Error Handling:
Testing:
Future-Proofing:
HttpClient with Laravel’s HttpClient (or use symfony/http-client-bridge).Serializer with Laravel’s Illuminate\Support\Serializer or symfony/serializer.guzzlehttp/guzzle (already used by Laravel).php-enum (replaced by PHP 8.1+ enums; no action needed).Phase 1: Wrapper Layer
laravel-inpost-pickup) with:
Inpost::findPoints()).// app/Providers/InpostServiceProvider.php
public function register()
{
$this->app->singleton(InpostClient::class, function ($app) {
return new InpostClient(
config('services.inpost.api_key'),
new HttpClient(),
new Serializer()
);
});
}
Phase 2: Core Integration
HttpClient with Laravel’s:
// Replace:
$client = new Client(['base_uri' => $baseUri]);
// With:
$client = Http::baseUrl($baseUri);
HttpClient syntax.Phase 3: Testing & Optimization
| Component | Laravel Equivalent | Notes |
|---|---|---|
Symfony HttpClient |
Illuminate\Http\Client |
Direct replacement. |
Symfony Serializer |
Illuminate\Support\Serializer |
Or use symfony/serializer package. |
| PHP Enums | Native PHP 8.1+ enums | No changes needed. |
| Guzzle 7.x | Laravel’s Guzzle wrapper | Already compatible. |
guzzlehttp/guzzle and symfony/serializer for breaking changes.HttpClient provides built-in error handling.setPage/setPerPage to avoid fetching all points at once.Cache::remember).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Inpost API Downtime | Checkout/pickup flow breaks | Fallback to home delivery option. |
| Rate Limiting | Slow responses or errors | Implement retry logic + caching. |
| Invalid Postcode Input | No points returned | Show user-friendly error + suggestions. |
| Symfony Component Breaking | Integration fails | Isolate dependencies in a package. |
| PHP Version Incompatibility | Bundle fails to load | Use Laravel’s PHP version manager. |
How can I help you explore Laravel packages today?