DONE: store mykad image in database

This commit is contained in:
ISMAIL MASSERAN
2026-09-03 11:29:20 +08:00
parent 4bf2de1e74
commit 6f4507dc08
6 changed files with 79 additions and 8 deletions
+9 -2
View File
@@ -358,7 +358,7 @@ class CustomersController extends Controller
])->json();
}
$customer_info = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/customers/create/' . $auth_user['cawangan'], [
$customer_payload = [
'kodcaw' => $auth_user['cawangan'],
'nopelanggan' => $no_pelanggan,
'nokpbaru' => $nokpbaru,
@@ -385,7 +385,14 @@ class CustomersController extends Controller
'nota_pekerjaan' => $request->nota_pekerjaan,
'notaarcc' => $request->notaarcc,
'tujuangadai' => $request->tujuan_gadai,
]);
];
if ($request->filled('photo_base64')) {
$customer_payload['photo_base64'] = $request->input('photo_base64');
$customer_payload['photo_mime'] = $request->input('photo_mime') ?: 'image/jpeg';
}
$customer_info = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/customers/create/' . $auth_user['cawangan'], $customer_payload);
Session::put('customer_info', $customer_info);
Session::put('noic', $request->noic);