rezzakurniawan / locanesia
Indonesia Province, City, Sub District, Villages. Data From nomor.net
v0.1.2
2018-03-27 12:35 UTC
Requires
- php: ^7.0
This package is auto-updated.
Last update: 2025-04-05 16:31:48 UTC
README
About
Laravel Package to populate and searching indonesia locations. From Provinces To Villages. Data Scraped from http://www.nomor.net/
Demo
Requirements
- Laravel 5.5+
- MySQL 5.6+ if using InnoDB
Installation Instructions
-
From your projects root folder in terminal run:
composer require rezzakurniawan/locanesia
-
Register the package
-
Laravel 5.5 and up Uses package auto discovery feature, no need to edit the
config/app.php
file. -
Laravel 5.4 and below Register the package with laravel in
config/app.php
underproviders
andaliases
with the following:
'providers' => [ ... rezzakurniawan\Locanesia\LocanesiaServiceProvider::class, ]; 'aliases' => [ ... 'Locanesia' => rezzakurniawan\Locanesia\LocanesiaFacade::class, ];
-
-
Migrate Database & Seed Database
php artisan migrate && php artisan db:seed --class=rezzakurniawan\\Locanesia\\Database\\Seed\\LocationSeeder
Basic Usage
variable term can part of full address, like "Buah Batu Bandung".
always call locanesia, use it :
use rezzakurniawan\Locanesia\Locanesia;
- For Full Text Search
/** * Full Text Search Location * * @param String $term Village, Postcode, Province, City Or combine * @param String $response json|array * @return void */ Locanesia::search($term, $response);
- Get All Province
/** * Get All Provinces * * @param String $response json|array * @return void */ Locanesia::getProvinces($response);
- Get All Cities By Provinces
/** * Get All Provinces * * @param String $provinces Province Name * @param String $response json|array * @return void */ Locanesia::getCities($provinces, $response);
- Get Detail Location By Postcode
/** * Get Detail Location By Postcode * * @param String $term postcode * @param String $response json|array * @return void */ Locanesia::getLocationByPostCode($term, $type);
License
Laravel Locanesia is Licensed under MIT. Enjoy!