Download the PHP package blissjaspis/laravel-rajaongkir-komerce without Composer
On this page you can find all versions of the php package blissjaspis/laravel-rajaongkir-komerce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blissjaspis/laravel-rajaongkir-komerce
More information about blissjaspis/laravel-rajaongkir-komerce
Files in blissjaspis/laravel-rajaongkir-komerce
Package laravel-rajaongkir-komerce
Short Description Laravel Rajaongkir From Komerce
License MIT
Homepage https://github.com/blissjaspis/laravel-rajaongkir-komerce
Informations about the package laravel-rajaongkir-komerce
Laravel RajaOngkir From Komerce
This package provides a simple and easy-to-use Laravel wrapper for the RajaOngkir Komerce API. It supports two methods of address lookup: hierarchical step-by-step selection and direct search with autocomplete functionality.
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.2 |
| Laravel | ^11.0, ^12.0, or ^13.0 |
Installation
You can install the package via composer:
You must publish the configuration file with:
Or using the provider:
Add the following to your .env file:
Set RAJAONGKIR_FAKE=true in local development to stub all API responses without calling Komerce.
The package is auto-discovered via Laravel's package discovery. No manual registration is required.
Usage
There are two ways to use Rajaongkir-Komerce:
- Step-by-step method. This was the old method before Komerce acquired Rajaongkir and changed the API.
- Direct Search. This is the latest method used by Komerce after they acquired Rajaongkir.
For existing users whose data is still using the old method, you can continue using method 1.
This package supports 2 ways to access RajaOngkir data:
- Step-by-step location lookup (
province -> city -> district -> subdistrict) - Direct search and shipping cost lookup (search by keyword, then calculate cost)
You can call the API through the facade or Laravel's service container:
API methods return a RajaOngkirResponse object with meta, data, status(), and successful(). Use getListCourier() when you need the static courier list (hardcoded from Komerce documentation — no API endpoint).
RajaOngkir is registered as a singleton in the service container, so the facade and app() resolve the same instance.
Error handling
Failed HTTP requests and API error responses throw BlissJaspis\RajaOngkir\Exceptions\RajaOngkirException:
Choosing Between Methods
Use Method 1 (Step-by-step) if:
- You have existing user data stored in the hierarchical format
- You prefer structured location selection with multiple dropdowns
- You're migrating from the old Rajaongkir API structure
Use Method 2 (Direct Search) if:
- You're building a new application
- You want a better user experience with search/autocomplete
- You want to simplify your frontend code and reduce API calls
- You want to provide international shipping options
Method 2 is recommended for new implementations as it provides a more modern and user-friendly approach.
Method 1: Step-by-Step Location Lookup
Use this method when users select addresses hierarchically.
1. Finding Provinces
2. Finding Cities
3. Finding Districts
4. Finding Subdistricts
Method 2: Direct Search and Cost Lookup
Use this method when users type destination keywords directly, then you calculate shipping.
1. Searching Domestic Destinations
2. Searching International Destinations
3. Calculating Domestic Shipping Cost
4. Calculating International Shipping Cost
5. Tracking Waybill
Other Useful Methods
getListCourier() returns a static list of supported courier codes and display names (not an API call):
API Reference
For comprehensive API documentation including:
- Complete method signatures with parameter types
- Detailed response structures
- Error handling examples
- Testing examples
- Best practices
- Migration guides
- Troubleshooting
Please see API-REFERENCE.md for detailed technical documentation optimized for developers and AI assistants.
Testing & Quality
This package uses GitHub Actions for continuous integration: lint runs once, then tests run across PHP 8.2–8.5 and Laravel 11–13.
| Command | Description |
|---|---|
composer test |
Run PHPUnit tests |
composer lint |
Syntax check, Pint (dry-run), and PHPStan (level 6) |
composer analyse |
Run PHPStan static analysis only |
composer format |
Auto-format code with Laravel Pint |
composer check |
Run lint + test (recommended before PRs) |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
For contribution guidelines and local development setup, see CONTRIBUTING.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Bliss Jaspis
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-rajaongkir-komerce with dependencies
guzzlehttp/guzzle Version ^7.9
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0