Welcome to the IDN Area repository! This package provides a complete dataset of Indonesian administrative areas for Laravel versions 8 to 12. You can access the data for provinces, regencies, districts, villages, and islands. This repository aims to simplify the integration of geographic and government data into your Laravel applications.
The IDN Area package is designed for developers who need reliable and structured data about Indonesia's administrative regions. This data can be crucial for applications that require geographic information, such as mapping services, government applications, and demographic studies.
By utilizing this package, you can easily manage and query administrative areas, allowing you to focus on building your application rather than gathering data.
- Comprehensive Dataset: Access data for all provinces, regencies, districts, villages, and islands in Indonesia.
- Laravel Integration: Seamlessly integrate with Laravel 8 to 12.
- Eloquent Support: Utilize Laravel's Eloquent ORM for easy data manipulation.
- PHP 8 Compatibility: Built to work efficiently with PHP 8.
- PHPStan Support: Includes static analysis for better code quality.
- Well-Documented: Clear documentation for easy setup and usage.
To install the IDN Area package, you can use Composer. Run the following command in your terminal:
composer require nourdugha/idn-area
Once the installation is complete, you can publish the configuration file with:
php artisan vendor:publish --provider="Nourdugha\IDNArea\IDNAreaServiceProvider"
This will allow you to customize the package settings according to your application's needs.
After installation, you can start using the data in your Laravel application. Hereโs a simple example to get you started:
You can fetch all provinces using Eloquent:
use Nourdugha\IDNArea\Models\Province;
$provinces = Province::all();
To get districts for a specific province:
use Nourdugha\IDNArea\Models\District;
$districts = District::where('province_id', $provinceId)->get();
For villages within a specific district:
use Nourdugha\IDNArea\Models\Village;
$villages = Village::where('district_id', $districtId)->get();
The IDN Area package organizes data into several models, each representing different administrative levels:
- Province: Represents the highest level of administrative division.
- Regency: Represents subdivisions within provinces.
- District: Represents subdivisions within regencies.
- Village: Represents the smallest administrative unit.
- Island: Represents geographic islands in Indonesia.
Each model has relationships defined to facilitate easy data retrieval.
class Province extends Model {
public function regencies() {
return $this->hasMany(Regency::class);
}
}
class Regency extends Model {
public function districts() {
return $this->hasMany(District::class);
}
}
We welcome contributions to improve the IDN Area package. If you want to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch to your forked repository.
- Open a pull request.
Please ensure that your code follows the project's coding standards and is well-documented.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest updates and versions of the IDN Area package, visit the Releases section. Here, you can find downloadable files that 7348 you need to execute in your projects.
If you have any questions or need assistance, feel free to open an issue in the repository or contact the maintainers. We aim to respond promptly to all inquiries.
The IDN Area package is a valuable resource for developers working with Indonesian administrative data. By integrating this package into your Laravel application, you can streamline data management and focus on building features that matter.
For more information, visit the Releases section for the latest updates.