Update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user