PHPackages                             agungtri222/laravel-rajaongkir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. agungtri222/laravel-rajaongkir

ActiveLibrary[API Development](/categories/api)

agungtri222/laravel-rajaongkir
==============================

RajaOngkir larvel request wrapper

v1.1(4y ago)07MITPHPPHP &gt;=7.2

Since Jul 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/agungtri222/laravel-rajaongkir)[ Packagist](https://packagist.org/packages/agungtri222/laravel-rajaongkir)[ RSS](/packages/agungtri222-laravel-rajaongkir/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (8)Versions (3)Used By (0)

Laravel RajaOngkir API Package
==============================

[](#laravel-rajaongkir-api-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c7cde3565df4be32beb746738ca8e574b7387df7782f79c6b5625ac54a4004a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6167756e677472693232322f6c61726176656c2d72616a616f6e676b69722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/agungtri222/laravel-rajaongkir)[![Software License](https://camo.githubusercontent.com/6ab40b23834c47484f912a0a6650db4d6f8e97d7cb633e01ac52fc179381edb9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6167756e677472693232322f6c61726176656c2d72616a616f6e676b69722e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Contributor Covenant](https://camo.githubusercontent.com/8e29a33f800f3630984f6f428f4f2454541fdfc5124f64c323ebd3e2b791744a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e7472696275746f72253230436f76656e616e742d76312e3425323061646f707465642d6666363962342e737667)](CODE_OF_CONDUCT.md)

*Laravel RajaOngkir API package.*

Requirements
------------

[](#requirements)

- [Laravel v5.5.\*](https://laravel.com)
- [guzzlehttp/guzzle v6.3.3](http://docs.guzzlephp.org/)

Install
-------

[](#install)

Require this package with composer using the following command:

```
composer require agungtri222/laravel-rajaongkir
```

Configuration
-------------

[](#configuration)

This package needs some configuration to utilizing RajaOngkir API Services. Add these lines to your .env, then update respective values based on your preferences.

```
RAJAONGKIR_ENDPOINT=
RAJAONGKIR_API_KEY=
```

Publish package configuration via command:

```
php artisan vendor:publish --provider="Agungtri222\RajaOngkir\Providers\RajaOngkirServiceProvider" --tag=config
```

RajaOngkir Service Facade
-------------------------

[](#rajaongkir-service-facade)

This package offers features to manage RajaOngkir API Request along with helpful facade `RajaOngkir`.

### City

[](#city)

Use it with syntax `RajaOngkir::city()`.

This will return array of all cities data.

see example below.

```
    229 => array:6 [
      "city_id" => "230"
      "province_id" => "21"
      "province" => "Nanggroe Aceh Darussalam (NAD)"
      "type" => "Kota"
      "city_name" => "Langsa"
      "postal_code" => "24412"
    ]
    230 => array:6 [
      "city_id" => "231"
      "province_id" => "24"
      "province" => "Papua"
      "type" => "Kabupaten"
      "city_name" => "Lanny Jaya"
      "postal_code" => "99531"
    ]
    231 => array:6 [
      "city_id" => "232"
      "province_id" => "3"
      "province" => "Banten"
      "type" => "Kabupaten"
      "city_name" => "Lebak"
      "postal_code" => "42319"
    ]
```

if you want to search by specified city id and province id use it with `RajaOngkir::city($cityId, $provinceId)` with string parameter `$cityId` and `$provinceId`

and it would return array of response data. see example below.

```
array:3 [
  "query" => array:2 [
    "city" => "39"
    "province" => "5"
  ]
  "status" => array:2 [
    "code" => 200
    "description" => "OK"
  ]
  "results" => array:5 [
    0 => array:6 [
      "city_id" => "39"
      "province_id" => "5"
      "province" => "DI Yogyakarta"
      "type" => "Kabupaten"
      "city_name" => "Bantul"
      "postal_code" => "55715"
    ]
    1 => array:6 [
      "city_id" => "135"
      "province_id" => "5"
      "province" => "DI Yogyakarta"
      "type" => "Kabupaten"
      "city_name" => "Gunung Kidul"
      "postal_code" => "55812"
    ]
    2 => array:6 [
      "city_id" => "210"
      "province_id" => "5"
      "province" => "DI Yogyakarta"
      "type" => "Kabupaten"
      "city_name" => "Kulon Progo"
      "postal_code" => "55611"
    ]
    3 => array:6 [
      "city_id" => "419"
      "province_id" => "5"
      "province" => "DI Yogyakarta"
      "type" => "Kabupaten"
      "city_name" => "Sleman"
      "postal_code" => "55513"
    ]
    4 => array:6 [
      "city_id" => "501"
      "province_id" => "5"
      "province" => "DI Yogyakarta"
      "type" => "Kota"
      "city_name" => "Yogyakarta"
      "postal_code" => "55111"
    ]
  ]
]
```

### Province

[](#province)

Use it with syntax `RajaOngkir::province()`.

if you want to search by specified city id and province id use it with `RajaOngkir::province($provinceId)` with string parameter `$provinceId`

### Currencies

[](#currencies)

Use it with syntax `RajaOngkir::currency()`

### Cost

[](#cost)

use it with syntax `RajaOngkir::cost($origin, $destination, $courier, $weight)` provide with string `$origin`, `$destination`, `$courier` and integer of total weight `$weight`

### International Cost

[](#international-cost)

use it with syntax `RajaOngkir::internationalCost($origin, $destination, $courier, $weight)` provide with string `$origin`, `$destination`, `$courier` and integer of total weight `$weight`

### Waybill

[](#waybill)

With `Waybill` method you can track your delivery status based on receipt number. use it with syntax `RajaOngkir::waybill($waybill, $courier)` provide the string of your receipt number and courier.

### International destination

[](#international-destination)

The `internationalDestination` method is used to get a list/name of the international shipping destination country. use it with syntax `RajaOngkir::internationalDestination($id)` with string parameter `$id`

### International origin

[](#international-origin)

The `internationalOrigin` method is used to get a list/name of cities that support international shipping. use it with syntax `RajaOngkir::internationalOrigin($id, $province)` with string parameter `$id` and `$province`

Testing
-------

[](#testing)

The tests are written with `phpunit`.

Please provide a `.env.testing` file in root package directory with contents same as `.env.example` before running test command.

You can run the tests from the root of the project directory with the following command.

```
vendor/bin/phpunit
```

License
-------

[](#license)

The Laravel RajaOngkir package is open source software licensed under the [GNU LGPL license version 3](https://opensource.org/licenses/LGPL-3.0)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1768d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0cca3f9e45cbe35e15e1c4ed122812d63e67f75a7ec2bcbbfaf0c83b3401680?d=identicon)[agungtri222](/maintainers/agungtri222)

---

Top Contributors

[![agungtri222](https://avatars.githubusercontent.com/u/12522461?v=4)](https://github.com/agungtri222 "agungtri222 (8 commits)")

---

Tags

apilaravelwrapperrajaongkir

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agungtri222-laravel-rajaongkir/health.svg)

```
[![Health](https://phpackages.com/badges/agungtri222-laravel-rajaongkir/health.svg)](https://phpackages.com/packages/agungtri222-laravel-rajaongkir)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[aerni/laravel-spotify

A Laravel wrapper for the Spotify Web API

209145.6k](/packages/aerni-laravel-spotify)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[lasserafn/laravel-economic

Economic REST wrapper for Laravel

1118.5k](/packages/lasserafn-laravel-economic)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
