add api for harga emas and marhun

This commit is contained in:
Zakwan Hamdan
2020-10-20 10:58:34 +08:00
parent 85cab92a3d
commit d566c2e499
8 changed files with 580 additions and 4 deletions
+6 -3
View File
@@ -20,11 +20,11 @@ class CustomerController extends Controller
return response()->json(Customer::on('mysql2')->find($id));
}
public function showOneCustomerByIC(Request $request){
public function showOneCustomerByIC($ic){
$customer = Customer::on('mysql2')
->where('kplama','=',$request->KpLama)
->orWhere('kpbaru','=',$request->KpBaru)
->where('kplama','=',$ic)
->orWhere('kpbaru','=',$ic)
->first();
return response()->json($customer);
@@ -55,6 +55,9 @@ class CustomerController extends Controller
public function create(Request $request)
{
$this->validate($request, [
]);
$customer = Customer::create($request->all());
return response()->json($customer, 201);