| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Modules\Dashboard\Repositories\Eloquent; |
||
| 23 | public function updateOrCreateForUser($widgets, $userId) |
||
| 24 | { |
||
| 25 | $widget = $this->findForUser($userId); |
||
| 26 | |||
| 27 | if ($widget) { |
||
| 28 | return $this->update($widget, ['widgets' => $widgets]); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $this->create(['widgets' => $widgets, 'user_id' => $userId]); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |