GithubHelp home page GithubHelp logo

vermaysha / laravel-wilayah-indonesia Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 2.1 MB

Laravel package yang berisi Data Wilayah Administrasi Indonesia yang tersusun berdasarkan Provinsi, Kabupaten, Kecamatan dan Desa

License: GNU Lesser General Public License v2.1

PHP 100.00%
laravel laravel-package wilayah-administratif wilayah-indonesia

laravel-wilayah-indonesia's Introduction

Laravel Wilayah Indonesia

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads LICENSE GitHub Release Date - Published_At

Package untuk laravel yang berisi Data Wilayah Administrasi Indonesia yang tersusun berdasarkan Provinsi, Kabupaten, Kecamatan dan Desa

Installation

Install package menggunakan composer

composer require vermaysha/laravel-wilayah-indonesia

Setelah package terinstall, jalankan kode dibawah

php artisan wilayah:install

File config serta migration akan otomatis tercopy ke folder masing-masing, lalu jalankan perintah dibawah

php artisan migrate
php artisan wilayah:seed

Usage/Examples

Gunakan beberapa model yang telah disediakan untuk mengolah data wilayah

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Vermaysha\Wilayah\Models\City;
use Vermaysha\Wilayah\Models\District;
use Vermaysha\Wilayah\Models\Province;
use Vermaysha\Wilayah\Models\Village;

class ExampleController extends Controller
{
    /**
     * Display all province
     */
    public function provinces(Request $request)
    {
        $province = Province::all();
        return $province;
    }

    /**
     * Display all province
     */
    public function cities(Request $request)
    {
        $city = City::limit(50)->get();
        return $city;
    }

    /**
     * Display all province
     */
    public function districts(Request $request)
    {
        $district = District::limit(50)->get();
        return $district;
    }

    /**
     * Display all province
     */
    public function villages(Request $request)
    {
        $village = Village::limit(50)->get();
        return $village;
    }
}

Running Tests

  composer test

Authors

License

LGPL-2.1

FAQ

Berapa banyak data provinsi, kabupaten, kecamatan dan desa yang tercantum ?

Data pada package ini diambil dari repository https://github.com/vermaysha/kode-wilayah-indonesia, yang sesuai dengan Permendagri No 58 Tahun 2021 (diperbaharui dengan Kepmendagri No. 050-145 Tahun 2022)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.