Merge branch 'staging' of https://dev.sismedika.online/febio/aso into staging

This commit is contained in:
2024-01-06 11:24:19 +07:00
4 changed files with 25 additions and 14 deletions

View File

@@ -59,12 +59,23 @@ class RequestLogController extends Controller
{
// Memulai transaksi
DB::beginTransaction();
// Membuat singkatan dari nama rumah sakit
$singkatan = "";
$words = explode(' ', $request->name_provider);
foreach ($words as $word) {
$singkatan .= strtoupper(substr($word, 0, 1));
}
// Membuat kode organisasi
$kodeOrganisasi = "ORG000" . $singkatan;
// Insert data ke tabel organizations
$organization_id = DB::table('organizations')
->insertGetId([
'name' => $request->name_provider,
'code' => $request->name_provider,
'code' => $kodeOrganisasi,
'type' => 'hospital',
'created_at' => now(),
'created_by' => auth()->user()->id