Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Create_produk_darah.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use App\Model\Master\ProdukDarah;
  3. use Illuminate\Database\Seeder;
  4. class Create_produk_darah extends Seeder
  5. {
  6. /**
  7. * Run the database seeds.
  8. *
  9. * @return void
  10. */
  11. public function run()
  12. {
  13. //
  14. DB::beginTransaction();
  15. $produk_darah = [
  16. ['AHF', 'AHF: Cryoprecipitated AHF'],
  17. ['FFP', 'FFP (Fresh Frozen Plasma)'],
  18. ['FP', 'FP: Fresh Plasma'],
  19. ['Lekosit Aferesis', 'Lekosit Aferesis'],
  20. ['Leucodepleted', 'Leucodepleted'],
  21. ['Leucoreduced', 'Leucoreduced'],
  22. ['LP', 'LP: Liquid Plasma'],
  23. ['LP Aferesis', 'LP AFERESIS'],
  24. ['PRC', 'PRC: Packed Red Cell'],
  25. ['PRC Aferesis', 'PRC AFERESIS'],
  26. ['PRC Pediatrik', ' PRC Pediatrik'],
  27. ['PRP', 'PRP (Platelet Rich Plasma)'],
  28. ['TC', 'TC: Trombocyte Concentrate'],
  29. ['TC Apheresis', 'TC Apheresis'],
  30. ['WB', 'WB: Whole Blood'],
  31. ['WE', 'WE: Washed Erythrocyte'],
  32. ];
  33. $arr_insert = [];
  34. foreach ($produk_darah as $key => $value) {
  35. $arr_insert[] = [
  36. 'nama' => $value[0],
  37. 'deskripsi' => $value[1],
  38. 'is_show' => 'Y',
  39. 'created_at' => date('Y-m-d H:i:s'),
  40. 'updated_at' => date('Y-m-d H:i:s'),
  41. ];
  42. }
  43. $sqlInsert = ProdukDarah::insert($arr_insert);
  44. if ($sqlInsert) {
  45. DB::commit();
  46. } else {
  47. DB::rollback();
  48. }
  49. }
  50. }