kodepintar/laravel-rajaongkir
A Laravel wrapper for the RajaOngkir API that makes it easy to look up Indonesian provinces, cities, districts, and shipping costs from couriers like JNE, TIKI, and POS, with simple configuration and a clean, expressive interface for your app.
Architecture fit. This is a thin HTTP wrapper — service provider, published config, and a client that fronts the RajaOngkir REST API for three capabilities: administrative lookups (provinces, cities, districts), domestic shipping cost quotes (origin, destination, weight, courier), and account/tier metadata. It belongs in the infrastructure layer, but the output is commercially sensitive: shipping cost is summed into the order total at checkout. That means the package must not be called directly from controllers or Blade templates. Wrap it behind an application-owned ShippingRateProvider contract so the vendor is an implementation detail and quotes can be cached, logged, faked in tests, and re-sourced without touching checkout logic. Two distinct workloads also need separating: reference data (provinces/cities/districts) is near-static and should be mirrored locally with a scheduled sync; rate quotes are dynamic and need a short-TTL cache. A package that fetches province lists on every page render is an architectural smell regardless of code quality.
Integration feasibility. Mechanically trivial — composer require, publish config, set the API key, call the facade. The effort is entirely in verification, not construction. At 7 stars, a score of 0.395, and a last release of September 2022, this is a low-adoption, single-maintainer artifact. The decisive feasibility question is framework compatibility: a 2022 package almost certainly caps at Laravel 9, which will block or force a composer.json constraint override on Laravel 10/11/12.
Technical risk. Three risks dominate, in order:
Key questions.
composer.json actually permit? Is there a maintained fork?Http facade / injectable Guzzle client, or construct transport internally (unmockable)?Stack fit. Assumes Laravel 8–9 / PHP 8.0–8.1, Composer-installed, configured via a published config file with the API key in .env. Confirm the transport is mockable before committing — if the client instantiates its own HTTP layer, testability and retry behaviour both degrade and the integration cost rises materially.
Migration path. Net-new, so there is no migration. Pin ^3.0.4 explicitly and commit the lockfile; do not let ^3.0 float, and do not permit 3.0.0–3.0.3 to resolve from a stale cache on any machine or CI runner. Verify the resolved version in CI with composer show.
Compatibility. Validate against the real application matrix rather than the package's claims:
Sequencing.
composer.json, src/, and the 3.0.4 diff before writing a line of application code. Ten minutes here decides whether the rest is worth doing.Http::fake() with a body assertion and a real echo-style validation against RajaOngkir's cost endpoint. Do not accept a 2xx as evidence.ShippingRateProvider (interface) plus a RajaOngkirRateProvider adapter and a FakeRateProvider for tests. Bind in a dedicated service provider.Maintenance. Assume unmaintained. Last release September 2022, 7 stars, no visible cadence. Treat the package as vendored code your team now owns: fork it into a private VCS or accept that a PHP/Laravel upgrade may strand you. Assign a named owner and put a quarterly "does upstream still work" check on the calendar. A stale Indonesian-language changelog compounds this — triage costs translation and interpretation time on top of normal review.
Support. Community-only, no SLA, no escalation. RajaOngkir/Komerce support covers the API, not this wrapper, so any breakage lands entirely on your team. If this package sits in the checkout path, the absence of support is a revenue risk, not just a technical one. Budget explicitly for the fallback adapter in the sequencing step — it is the cheapest insurance available and it is small.
Scaling. All cost is outbound HTTP against a tiered quota. Three mitigations: cache reference data locally (removes the majority of calls), cache quotes with a short TTL and normalise the cache key (round weight to realistic buckets), and never call the API synchronously on a hot path if it can be precomputed at cart-update or address-selection time. Watch for retry storms against a 429 — the package's retry behaviour, if any, must respect Retry-After. Retries on a non-idempotent POST are only safe because this endpoint is a read-shaped quote, but confirm that assumption rather than inheriting it.
Failure modes.
Ramp-up. The code surface is small — a mid-level Laravel developer is productive in half a day. The real cost is domain comprehension: Indonesian courier semantics (JNE, POS, TIKI, SiCepat, Anteraja), gram-based weight and dimensional rounding rules, origin=warehouse-city conventions, and validating that quoted rates match what operations expects. Allocate senior review time for the 3.0.4 diff and for the quote-validation test suite. Realistically: one engineer-week end to end including the fallback adapter and local reference-data sync, and I would not approve the integration without that week.
How can I help you explore Laravel packages today?