Download the PHP package d1msky/nusantara-shipping without Composer

On this page you can find all versions of the php package d1msky/nusantara-shipping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nusantara-shipping

Nusantara — Indonesia Region Data for Laravel

Tests

Official Indonesian administrative region data (Kepmendagri 2025) for Laravel — with shipping address formatting, postal code lookup, fuzzy search, and dual-mode storage (file or database). Built for Laravel apps anywhere in the world that need to handle Indonesian addresses (e.g. e‑commerce, logistics, forms).


Why this package?

Feature Nusantara Others
Data Kepmendagri 2025 (updateable via command) Often 2018–2022
Storage File (zero DB) or Database Usually DB-only or file-only
Shipping Address formatter, postal lookup, coordinates Rare or basic
Search Fuzzy + Indonesian aliases (Jkt, Jaksel, SBY, …) Exact or simple like
DX PHP 8.1+ enums, typed API, caching Varies

Use it for: dropdowns (provinces → regencies → districts → villages), address validation, shipping labels, postal code checks, and search that understands “Jaksel”, “Surabaya”, “Jogja”, etc.


Requirements


Installation

Publish config (optional):

Or manually:

For database mode (optional):


Quick start


Configuration

Publish and edit config/nusantara.php:

Option Default Description
driver file file (no DB) or database
table_prefix nusantara_ Table prefix in database mode
cache_ttl 86400 Cache TTL (seconds); 0 = no cache
cache_store null Cache store (null = default)
data_path package data/ Path to PHP data files (file driver)
search.fuzzy_threshold 70 Min similarity (0–100) for fuzzy match
search.max_results 20 Max search results
aliases [] Custom alias → region name for search
shipping_styles [] Custom courier formats

Env example:


Database mode

  1. Set NUSANTARA_DRIVER=database.
  2. Run migrations:

  3. Seed from package data files:

Tables: nusantara_provinces, nusantara_regencies, nusantara_districts, nusantara_villages.


Artisan commands

Command Description
nusantara:install Publish config; optional --migrate and --seed
nusantara:seed Seed DB from data files (--only=provinces|regencies|districts|villages)
nusantara:update-data Show data source info; use --source=<path_or_url> to fetch and transform
nusantara:stats Print counts (provinces, regencies, districts, villages, postal codes)
nusantara:clear-cache Clear Nusantara cache

Extending

Custom search aliases (config/nusantara.php):

Custom shipping style:

Then: Nusantara::shippingAddress($code, style: 'my_courier').


Data source and updates

Region data follows Kepmendagri (Indonesian Ministry of Home Affairs). The package ships with sample data so it works out of the box. For full or up-to-date datasets, use the nusantara:update-data command.

Command

Input: path or URL

Type Example Description
Local folder --source=/path/to/data Folder must contain at least provinces.json. Optional: regencies.json, districts.json, villages.json.
Base URL --source=https://example.com/data Command will request {url}/provinces.json, {url}/regencies.json, etc. Each must return a JSON array.

For a local folder, the path must be absolute or relative to the current working directory. For a URL, use a base URL that serves the JSON files directly (e.g. raw GitHub or a CDN).

Required and optional files

File Required Description
provinces.json Yes Array of province objects.
regencies.json No Array of regency/kabupaten/kota objects.
districts.json No Array of district/kecamatan objects.
villages.json No Array of village/kelurahan/desa objects.

If a file is missing, that level is skipped; existing PHP data for that level is not overwritten.

Expected JSON structure

Each file must be a JSON array of objects. The command normalizes common field names:

Codes can be dotted (e.g. 32.73) or plain (e.g. 3273); the command normalizes to dotted format where applicable.

Example: URL (raw GitHub)

This URL serves provinces.json, regencies.json, districts.json, and villages.json directly.

Example: local folder

  1. Clone a repo that contains JSON (e.g. in a data or data/list_of_area folder).
  2. Run:

The folder must contain at least provinces.json.

After updating data

Then check counts:

Recommended public sources


Testing

To generate a coverage report (requires PCOV or Xdebug):


Contributing

Contributions are welcome. Please open an issue or PR on GitHub.


License

MIT. See LICENSE.


All versions of nusantara-shipping with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package d1msky/nusantara-shipping contains the following files

Loading the files please wait ...