Update
This commit is contained in:
@@ -59,12 +59,23 @@ class RequestLogController extends Controller
|
|||||||
{
|
{
|
||||||
// Memulai transaksi
|
// Memulai transaksi
|
||||||
DB::beginTransaction();
|
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
|
// Insert data ke tabel organizations
|
||||||
$organization_id = DB::table('organizations')
|
$organization_id = DB::table('organizations')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'name' => $request->name_provider,
|
'name' => $request->name_provider,
|
||||||
'code' => $request->name_provider,
|
'code' => $kodeOrganisasi,
|
||||||
'type' => 'hospital',
|
'type' => 'hospital',
|
||||||
'created_at' => now(),
|
'created_at' => now(),
|
||||||
'created_by' => auth()->user()->id
|
'created_by' => auth()->user()->id
|
||||||
|
|||||||
Reference in New Issue
Block a user