- How do I install kavist/rajaongkir in a Laravel app?
- Install it with Composer using composer require kavist/rajaongkir. In Laravel, the package provides a service provider, config publishing, and a facade, so you can publish its config and add your RajaOngkir API key. Then use the facade or injected client in your checkout or shipping service.
- Which Laravel versions does kavist/rajaongkir support?
- The package is built as a standard Laravel package with a service provider, publishable config, and facade. Exact Laravel version support is defined by the package composer constraints, so check its composer.json or Packagist metadata before upgrading a production app. That is especially important if you are moving from a cURL-based 1.0 install to 1.1.0.
- What changed in kavist/rajaongkir v1.1.0?
- In v1.1.0 the BasicClient transport was rewritten from cURL to file_get_contents with a stream context, reportedly to reduce the cURL dependency and improve compatibility. Public method signatures appear unchanged, so it is an internal transport change rather than an API redesign. Because it shipped in a minor version, ^1.0 constraints can absorb it automatically.
- Does kavist/rajaongkir v1.1.0 require allow_url_fopen?
- Yes, the file_get_contents HTTP transport depends on allow_url_fopen being enabled. If it is disabled, calls can emit a warning and return false rather than throwing a clean exception. Check this setting in local, staging, CI, and any customer-hosted or on-prem PHP environments.
- How do I handle errors and timeouts in kavist/rajaongkir after v1.1.0?
- With file_get_contents, failures return false and the response status is available through the magic $http_response_header local, so error handling is less typed than with cURL. You must set an explicit timeout in stream_context_create to avoid unbounded hangs on checkout-path calls. Confirm whether the package normalizes non-2xx responses and false returns into the same exceptions as before, and add your own handling if it does not.
- Which HTTP client does the Laravel service provider bind: BasicClient or Guzzle?
- The evaluation specifically flags this as needing confirmation: check whether the Laravel service provider binds BasicClient or a separate Guzzle or Laravel-specific client. If Laravel users resolve a different client, the BasicClient transport rewrite may be a no-op for them and the allow_url_fopen risk is overstated. If a binding override exists, you can potentially keep cURL while still accepting the release.
- Is kavist/rajaongkir safe for production checkout flows?
- It is a thin SDK but it sits on the latency-sensitive checkout path, so transport reliability matters. Before using 1.1.0 in production, verify allow_url_fopen in every target environment, set explicit timeouts, and confirm how 4xx and 5xx API errors are surfaced. If those checks fail, pin to a cURL-based version or override the client binding.
- Can I still use cURL with kavist/rajaongkir 1.1.0?
- Possibly, but only if the package exposes a client interface or a binding override in its Laravel service provider. If it does, bind your own cURL-based client or pin to a prior 1.x release that still uses cURL. Confirm this in the source before upgrading under a ^1.0 constraint.
- How do I calculate shipping cost (ongkir) with kavist/rajaongkir?
- It wraps the RajaOngkir API for Indonesian courier cost quotes such as JNE, TIKI, and POS, and for province and city lookups. Typical usage is to resolve origin and destination IDs, then request cost with weight and courier parameters from your cart or checkout service. The package aims to provide clean, ready-to-use methods for that ongkir flow.
- Are there alternatives to kavist/rajaongkir for RajaOngkir in Laravel?
- You can call the RajaOngkir API directly with Laravel's HTTP client or Guzzle, or evaluate another RajaOngkir SDK. When comparing alternatives, check Laravel integration, transport behavior, error semantics, timeout defaults, and whether the package is actively maintained. For checkout flows, test the chosen option against the same API error and environment cases.