PHPackages                             didikz/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. didikz/laravel-rajaongkir

ActiveLibrary

didikz/laravel-rajaongkir
=========================

Rajaongkir API Wrapper for Laravel Framework

0.1.1(5y ago)141[1 PRs](https://github.com/didikz/laravel-rajaongkir/pulls)MITPHPPHP ^7.3

Since Nov 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/didikz/laravel-rajaongkir)[ Packagist](https://packagist.org/packages/didikz/laravel-rajaongkir)[ RSS](/packages/didikz-laravel-rajaongkir/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Laravel Rajaongkir
==================

[](#laravel-rajaongkir)

[![Latest Stable Version](https://camo.githubusercontent.com/d98b9b54b7659ca96e62b3b9296db29550d5eb8eb1e1d0be59dfa1d5fcbd39b5/68747470733a2f2f706f7365722e707567782e6f72672f646964696b7a2f6c61726176656c2d72616a616f6e676b69722f76)](//packagist.org/packages/didikz/laravel-rajaongkir) [![Total Downloads](https://camo.githubusercontent.com/ad28c97b14a279a6850334b2393c32cc683edbebb52efdce317a6bbed8b2e0e8/68747470733a2f2f706f7365722e707567782e6f72672f646964696b7a2f6c61726176656c2d72616a616f6e676b69722f646f776e6c6f616473)](//packagist.org/packages/didikz/laravel-rajaongkir) [![Latest Unstable Version](https://camo.githubusercontent.com/862c5573661f1214d5b0e7bfaf21d66f36e8d8c77ea7fd8ec4bdcc1b1675cd47/68747470733a2f2f706f7365722e707567782e6f72672f646964696b7a2f6c61726176656c2d72616a616f6e676b69722f762f756e737461626c65)](//packagist.org/packages/didikz/laravel-rajaongkir) [![License](https://camo.githubusercontent.com/3445c919cd34e0640c5b222e0ac69e062911e6aab76ba4971d302e8c007743d1/68747470733a2f2f706f7365722e707567782e6f72672f646964696b7a2f6c61726176656c2d72616a616f6e676b69722f6c6963656e7365)](//packagist.org/packages/didikz/laravel-rajaongkir)

[![alt text](https://camo.githubusercontent.com/d263ad9316091cfd3ceec68c09a5d46949c3f2e63ec9e16ce06ef8659c3a96a0/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323052616a616f6e676b69722e706e673f7468656d653d6c69676874267061636b6167654e616d653d646964696b7a2532466c61726176656c2d72616a616f6e676b6972267061747465726e3d746963546163546f65267374796c653d7374796c655f31266465736372697074696f6e3d52616a616f6e676b69722b4150492b73696d706c652b777261707065722b666f722b4c61726176656c266d643d3126666f6e7453697a653d313030707826696d616765733d747275636b "Laravel RajaOngkir Logo")](https://camo.githubusercontent.com/d263ad9316091cfd3ceec68c09a5d46949c3f2e63ec9e16ce06ef8659c3a96a0/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c25323052616a616f6e676b69722e706e673f7468656d653d6c69676874267061636b6167654e616d653d646964696b7a2532466c61726176656c2d72616a616f6e676b6972267061747465726e3d746963546163546f65267374796c653d7374796c655f31266465736372697074696f6e3d52616a616f6e676b69722b4150492b73696d706c652b777261707065722b666f722b4c61726176656c266d643d3126666f6e7453697a653d313030707826696d616765733d747275636b)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require didikz/laravel-rajaongkir
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Didikz\LaravelRajaongkir\LaravelRajaongkirServiceProvider" --tag="config"
```

Add api key to your `.env` file:

```
RAJAONGKIR_API_KEY=apikeyfromrajaongkir
```

Usage
-----

[](#usage)

### Get All Provinces

[](#get-all-provinces)

```
use Didikz\LaravelRajaOngkir\Location;

$location = new Location(config('laravel-rajaongkir.api_key');
$location->province();

// or using facade
use Didikz\LaravelRajaongkir\Facade\Location;

$provinces = Location::province();
```

### Get Province by Id

[](#get-province-by-id)

```
use Didikz\LaravelRajaOngkir\Location;

$location = new Location(config('laravel-rajaongkir.api_key');
$province = $location->province(1);

// or using facade
use Didikz\LaravelRajaongkir\Facade\Location;

$province = Location::province(1);
```

### Get All Cities by Province Id

[](#get-all-cities-by-province-id)

```
use Didikz\LaravelRajaOngkir\Location;

$provinceId = 1;
$location = new Location(config('laravel-rajaongkir.api_key');
$cities = $location->city($provinceId);

// or using facade
use Didikz\LaravelRajaongkir\Facade\Location;

$provinceId = 1;
$cities = Location::city($provinceId);
```

### Get city

[](#get-city)

```
use Didikz\LaravelRajaOngkir\Location;

$provinceId = 6;
$cityId = 152;
$location = new Location(config('laravel-rajaongkir.api_key');
$city = $location->city($provinceId, $cityId);

// or using facade
use Didikz\LaravelRajaongkir\Facade\Location;

$provinceId = 6;
$cityId = 152;
$city = Location::city($provinceId, $cityId);
```

### Calculate Cost

[](#calculate-cost)

Check [Available Couriers](https://rajaongkir.com/dokumentasi#daftar-kurir) based on their plan

```
use Didikz\LaravelRajaOngkir\Cost;

$cost = new Cost(config('laravel-rajaongkir.api_key');
$cost->destination(152)->origin(155)->weight(2000)->courier('jne')->calculate();

// or using facade
use Didikz\LaravelRajaOngkir\Facade\Cost;

$cost = Cost::destination(152)->origin(155)->weight(2000)->courier('jne')->calculate();
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Didik Tri S](https://github.com/didikz)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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

Every ~1 days

Total

2

Last Release

2014d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3158533?v=4)[Didik Tri Susanto](/maintainers/didikz)[@didikz](https://github.com/didikz)

---

Top Contributors

[![didikz](https://avatars.githubusercontent.com/u/3158533?v=4)](https://github.com/didikz "didikz (5 commits)")

---

Tags

laravelphp7rajaongkirrajaongkir-apilaravelApi Wrapperrajaongkir

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

29428.0k](/packages/sunchayn-nimbus)

PHPackages © 2026

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