- How do I install and set up Laravel Nusa in a Laravel app?
- Install it with composer require creasi/laravel-nusa. The service provider, publishable config, translations, migrations, and nusa-prefixed routes are auto-registered, so most projects need little manual wiring. Make sure the SQLite PHP extension is enabled, then query a single province-to-village path to confirm the bundled dataset and nusa connection are working.
- Which Laravel and PHP versions does Laravel Nusa support?
- The package targets Laravel 9 through 13 on PHP 8.2 or newer and requires the SQLite PHP extension in every runtime image, including local, CI, staging, and production. Check the host application's Laravel and PHP constraints against the package composer.json before adding it. Also confirm testbench and PHPUnit versions line up for CI parity, and verify tagged releases yourself since the metadata includes a future-dated 2026 release.
- Does Laravel Nusa use a separate SQLite database from my main application?
- Yes. Laravel Nusa ships a dedicated SQLite-backed nusa connection that is deliberately isolated from your primary database, so it does not touch your MySQL or Postgres tables. That isolation is a clean seam, but it does mean you are operating two persistence stores. If your production environment has no local disk persistence, plan for a read replica or scheduled sync rather than a mounted SQLite file.
- Can I publish the config, migrations, and translations in Laravel Nusa?
- Yes. Config, migrations, and translations are publishable, so you can adopt the package incrementally: publish the config first, then migrations if you intend to own the address tables, then translations if the UI is Indonesian-facing. Publishing migrations lets you inspect the schema before committing to it. Most teams keep the bundled dataset read-only and add a thin repository or service layer instead of modifying the shipped tables.
- How do I query provinces, regencies, districts, and villages with Eloquent in Laravel Nusa?
- Use the provided Eloquent models to walk the Province, Regency, District, and Village hierarchy. Primary keys are non-incrementing string codes aligned with official BPS and kemendagri codes, and the models skip timestamps because the data is read-mostly reference data. A typical query chains relationships, for example loading a province with its regencies and then drilling down to districts and villages.
- Can I extend Laravel Nusa models or add columns for tenant scoping?
- The models can be subclassed or extended, but keep the string primary keys and timestamp-less read-mostly design in mind. For tenant scoping or extra columns, the safer pattern is an anti-corruption layer or repository in your app that wraps the package models rather than altering the shipped schema. If you publish migrations and own the tables, you can add columns, but be prepared to reconcile them on every dataset refresh.
- How do I sync Laravel Nusa data into MySQL or PostgreSQL?
- There is no documented built-in path for syncing the dataset into a non-SQLite store; the package relies on its own SQLite connection. You can read from the nusa connection and ETL the four-level hierarchy into MySQL or Postgres with a custom Artisan command or queued job. If you expect to swap data providers later, put an interface in front of the models now so the rest of your code does not depend on the SQLite source.
- Is Laravel Nusa maintained, and how often is the Indonesian region data updated?
- The package is MIT-licensed and single-maintainer, with roughly 101 stars and no dependents at the time of assessment, so community validation is limited. Upstream data comes from cahyadsn's wilayah and postal-code datasets and is refreshed through a Docker-driven composer upstream:up import, with no scheduled or automated update path published. Verify release cadence and region re-codes yourself before relying on it, since the metadata shows a future-dated 2026 release.
- Are the nusa API routes in Laravel Nusa authenticated or rate limited by default?
- The package auto-registers REST API routes under the nusa prefix, but the documentation reviewed does not describe default authentication or rate limiting, so treat them as public until you verify otherwise. You can wrap them with your own middleware, gate them behind auth, throttle them, or disable them entirely if your application already queries the models with Eloquent. For production, put throttling in front of any nusa route you expose.
- What are the alternatives to Laravel Nusa for Indonesian region data?
- Alternatives include importing cahyadsn's wilayah dataset directly or loading official BPS and kemendagri region codes into your own tables. Laravel Nusa's advantage is that it bundles the four-level hierarchy with Eloquent models, migrations, seeders, and helpers out of the box, so you avoid building the import pipeline yourself. If you need postal-code accuracy or administrative boundary polygons, evaluate those sources separately, since data provenance and licensing need their own legal review.