Created
September 23, 2022 13:14
-
-
Save FranklysG/d78643fa42896cae96ada1a5c14d40d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function __invoke() | |
{ | |
try { | |
$this->provinsi = collect(json_decode((new Client())->get("{$this->url}getwilayah")->getBody()->getContents(), true)); | |
$this->requests($this->provinsi, 'kabupaten'); | |
$this->requests($this->kabupaten, 'kecamatan'); | |
$this->requests($this->kecamatan, 'desa'); | |
return response($this->desa); | |
} catch (ClientException $e) { | |
report($e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment