| Conditions | 2 |
| Paths | 2 |
| Total Lines | 29 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function run() |
||
| 18 | { |
||
| 19 | Model::unguard(); |
||
| 20 | |||
| 21 | $anggarans = (object) [ |
||
| 22 | (object) [ |
||
| 23 | 'user_id' => '1', |
||
| 24 | 'group_egovernment_id' => '1', |
||
| 25 | 'label' => 'GroupEgovernment 1', |
||
| 26 | 'description' => 'GroupEgovernment satu' |
||
| 27 | ], |
||
| 28 | (object) [ |
||
| 29 | 'user_id' => '2', |
||
| 30 | 'group_egovernment_id' => '2', |
||
| 31 | 'label' => 'GroupEgovernment 2', |
||
| 32 | 'description' => 'GroupEgovernment dua', |
||
| 33 | ] |
||
| 34 | ]; |
||
| 35 | |||
| 36 | foreach ($anggarans as $anggaran) { |
||
| 37 | $model = Anggaran::updateOrCreate( |
||
| 38 | [ |
||
| 39 | 'user_id' => $anggaran->user_id, |
||
| 40 | 'group_egovernment_id' => $anggaran->group_egovernment_id, |
||
| 41 | 'label' => $anggaran->label, |
||
| 42 | 'description' => $anggaran->description, |
||
| 43 | ] |
||
| 44 | ); |
||
| 45 | $model->save(); |
||
| 46 | } |
||
| 49 |