| Conditions | 2 |
| Paths | 2 |
| Total Lines | 35 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function run() |
||
| 18 | { |
||
| 19 | Model::unguard(); |
||
| 20 | |||
| 21 | $master_sktms = (object) [ |
||
| 22 | (object) [ |
||
| 23 | 'user_id' => '1', |
||
| 24 | 'juara' => '1', |
||
| 25 | 'tingkat' => '1', |
||
| 26 | 'nilai' => '10', |
||
| 27 | 'bobot' => '1' |
||
| 28 | ], |
||
| 29 | (object) [ |
||
| 30 | 'user_id' => '1', |
||
| 31 | 'juara' => '2', |
||
| 32 | 'tingkat' => '2', |
||
| 33 | 'nilai' => '20', |
||
| 34 | 'bobot' => '2' |
||
| 35 | ] |
||
| 36 | ]; |
||
| 37 | |||
| 38 | foreach ($master_sktms as $master_sktm) { |
||
| 39 | $model = MasterSktm::updateOrCreate( |
||
| 40 | [ |
||
| 41 | 'user_id' => $master_sktm->user_id, |
||
| 42 | 'juara' => $master_sktm->juara, |
||
| 43 | 'tingkat' => $master_sktm->tingkat, |
||
| 44 | 'nilai' => $master_sktm->nilai, |
||
| 45 | 'bobot' => $master_sktm->bobot, |
||
| 46 | |||
| 47 | ] |
||
| 48 | ); |
||
| 49 | $model->save(); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 55 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.