add jenis emas and lelong api

This commit is contained in:
Zakwan Hamdan
2020-11-01 08:45:53 +08:00
parent 508270157c
commit 2486f10ff7
7 changed files with 167 additions and 20 deletions
+10 -1
View File
@@ -9,7 +9,16 @@ class HargaEmasController extends Controller
{
public function showAllHargaEmas()
{
return response()->json(HargaEmas::all());
return response()->json(HargaEmas::on('mysql7')->orderby('recno')->get());
}
public function getOneHargaEmas($karat){
$karat_string = str_replace('-','.',$karat);
$harga_emas = HargaEmas::on('mysql7')->select('harga2')->where('karat','=',$karat_string)->first();
return response()->json($harga_emas);
}
public function update($id, Request $request)