add api negeri poskod daerah

This commit is contained in:
Zakwan Hamdan
2020-11-02 16:56:57 +08:00
parent 07a3185834
commit 6aa1d91f5b
7 changed files with 142 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers;
use App\Daerah;
use Illuminate\Http\Request;
class DaerahController extends Controller
{
public function showOneDaerah($koddaerah)
{
$daerah = Daerah::on('mysql7')
->where('koddaerah','=',$koddaerah)
->first();
return response()->json($daerah);
}
}