Skip to content

nurmanhabib/kewilayahan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kewilayahan Indonesia API

Install

  • Instalasi dengan Composer
     $ composer require nurmanhabib/kewilayahan
     
  • Tambahkan Nurmanhabib\Kewilayahan\KewilayahanServiceProvider::class pada config/app.php
     'providers' => [
         ...         
         Nurmanhabib\Kewilayahan\KewilayahanServiceProvider::class,
     ]
     
  • Copy file config.php ke config/kewilayahan.php
     $ php artisan vendor:publish --provider="Nurmanhabib\Kewilayahan\KewilayahanServiceProvider"
     
  • Create table dengan migration
     $ php artisan migrate
     
  • Insert data seeder kewilayahan
     $ php artisan db:seed --class="KewilayahanSeeder"
     

Penggunaan

$kewilayahan = app('kewilayahan');
$kewilayahan->setQuery($request->all());
$kewilayahan->setOutput('api');

$kewilayahan->setOutput(function ($data) use ($request) {
	$selected = ['selected' => 'tes'];

	return array_merge($data, [$selected]);
});

return $kewilayahan->load();

License

Apache

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published