https://github.com/erkurn/locanesia
Laravel Package to populate and searching indonesia locations. From Provinces To Villages. Data Scraped from http://www.nomor.net/
https://github.com/erkurn/locanesia
data-scraping laravel localization province village
Last synced: 10 days ago
JSON representation
Laravel Package to populate and searching indonesia locations. From Provinces To Villages. Data Scraped from http://www.nomor.net/
- Host: GitHub
- URL: https://github.com/erkurn/locanesia
- Owner: erkurn
- License: mit
- Created: 2018-03-20T07:49:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T12:36:17.000Z (almost 8 years ago)
- Last Synced: 2025-07-29T09:37:37.214Z (6 months ago)
- Topics: data-scraping, laravel, localization, province, village
- Language: PHP
- Size: 2.66 MB
- Stars: 6
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Locanesia
- [About](#about)
- [Demo](#demo)
- [Requirements](#requirements)
- [Installation Instructions](#installation-instructions)
- [Basic Usage](#basic-usage)
- [License](#license)
### About
Laravel Package to populate and searching indonesia locations. From Provinces To Villages. Data Scraped from http://www.nomor.net/
### Demo
[](https://www.youtube.com/watch?v=OzA9Hh5EYWk)
### Requirements
* [Laravel 5.5+](https://laravel.com/docs/installation)
* MySQL 5.6+ if using InnoDB
### Installation Instructions
1. From your projects root folder in terminal run:
```bash
composer require rezzakurniawan/locanesia
```
2. 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` under `providers` and `aliases` with the following:
```php
'providers' => [
...
rezzakurniawan\Locanesia\LocanesiaServiceProvider::class,
];
'aliases' => [
...
'Locanesia' => rezzakurniawan\Locanesia\LocanesiaFacade::class,
];
```
3. Migrate Database & Seed Database
```bash
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 :
``` php
use rezzakurniawan\Locanesia\Locanesia;
```
1. For Full Text Search
```php
/**
* Full Text Search Location
*
* @param String $term Village, Postcode, Province, City Or combine
* @param String $response json|array
* @return void
*/
Locanesia::search($term, $response);
```
2. Get All Province
```php
/**
* Get All Provinces
*
* @param String $response json|array
* @return void
*/
Locanesia::getProvinces($response);
```
3. Get All Cities By Provinces
```php
/**
* Get All Provinces
*
* @param String $provinces Province Name
* @param String $response json|array
* @return void
*/
Locanesia::getCities($provinces, $response);
```
4. Get Detail Location By Postcode
```php
/**
* 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!