answear/mwl-pickup-point-bundle
symfony/http-kernel, symfony/serializer, etc.), but Laravel’s Symfony Bridge (illuminate/support) allows partial integration. Key dependencies like Guzzle (HTTP client) and Webmozart Assert are Laravel-compatible.GetPickupPoints, GetCities) aligns with Laravel’s console/artisan or service-layer patterns. Can be wrapped in a facade or service class for cleaner usage.ConfigProvider).answear_mwl.yaml) maps cleanly to Laravel’s config/mwl.php with environment variables for partnerKey/secretKey.symfony/property-access (Laravel alternative: Illuminate\Support\Facades\Arr or Str::of()).Enum usage (Laravel 10+ supports PHP 8.1 enums natively; backport needed for older versions).HttpClientException). Custom exceptions may be needed.phpunit setup to Laravel’s PHPUnit or Pest.Laravel\Http\Retries).Cache facade) to avoid rate limits?partnerKey/secretKey stored securely (Laravel’s Vault or .env)?Locale middleware or trans() may need extension.PickupPointController).Spatie/Laravel-enum for older versions.composer require answear/mwl-pickup-point-bundle guzzlehttp/guzzle
php artisan vendor:publish --tag="answear-mwl-config"
(Adapt config/answear_mwl.yaml to Laravel’s config/mwl.php.)// app/Services/MwlService.php
class MwlService {
public function __construct(
private GetPickupPoints $getPickupPoints,
private GetCities $getCities
) {}
public function fetchPickupPoints(array $carriers, string $countryCode) {
return $this->getPickupPoints->execute(
new GetPickupPointsByCarriersAndCountryCodesRequest(
array_map(fn($carrier) => new CarrierAndCountryCode(
CarrierEnum::from($carrier),
CountryCodeEnum::Ukraine
), $carriers)
)
);
}
}
// app/Facades/Mwl.php
Facade::register('Mwl', MwlService::class);
Usage: Mwl::fetchPickupPoints(['Meest'], 'UA').symfony/property-access with Laravel’s Arr/Str.symfony/http-kernel interfaces if using HTTP tests.Http facade to mock Guzzle calls:
Http::fake([
'api.mwl.com/*' => Http::response([...]),
]);
Cache::remember() for 1-hour TTL).answear/mwl-pickup-point-bundle for MWL API changes. Laravel’s composer.json can pin versions.Log facade to commands for debugging:
Log::debug('MWL API response', ['data' => $response->getData()]);
Sentry or Laravel Error Tracking to log MWL API failures.Laravel\Http\Retries).README (contribute upstream).Cache for local storage of pickup points.dispatchSync()) for bulk fetches.pickup_points table with:
Schema::create('pickup_points', function (Blueprint $table) {
$table->id();
$table->string('carrier');
$table->string('country_code');
$table->json('coordinates');
$table->timestamps();
});
| Failure | Impact | Mitigation |
|---|---|---|
| MWL API downtime | Pickup points unavailable | Cache stale data + retry with backoff. |
| Invalid API credentials | All requests fail | Validate partnerKey/secretKey on startup. |
| Rate limiting | Throttled requests | Implement exponential backoff. |
| Schema changes in MWL API | Bundle breaks | Feature flags for deprecated endpoints. |
| Database overload | Slow queries | Add indexes to pickup_points table. |
.env keys).fetchPickupPoints, getCities) in Laravel’s app/docs folder.PickupPointFinder trait for reusable logic.answear_mwl.* logs in Laravel’s storage/logs.How can I help you explore Laravel packages today?