Add backend operation to use with MyKad reader feature

This commit is contained in:
afiq.hamzah
2023-03-06 10:33:22 +08:00
parent a272171ebb
commit 812191032c
5 changed files with 50 additions and 16 deletions
+8 -2
View File
@@ -7,6 +7,12 @@ use Illuminate\Http\Request;
class DaerahController extends Controller
{
public function index()
{
$daerah = Daerah::on('mysql7')->with('negeri')->get();
return response()->json($daerah);
}
public function showOneDaerah($koddaerah)
{
$daerah = Daerah::on('mysql7')
@@ -20,7 +26,7 @@ class DaerahController extends Controller
$daerah = Daerah::on('mysql7')
->where('kodnegeri','=',$kodnegeri)
->get();
return response()->json($daerah);
}
}
}