| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function refresh() |
||
| 38 | { |
||
| 39 | if (!$this->exists) { |
||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->setRawAttributes( |
||
| 44 | static::newQueryWithoutScopes()->findOrFail($this->getKey())->attributes |
||
|
|
|||
| 45 | ); |
||
| 46 | |||
| 47 | $this->load(Collection::make($this->relations)->reject(function ($relation) { |
||
| 48 | return $relation instanceof Pivot; |
||
| 49 | })->keys()->all()); |
||
| 50 | |||
| 51 | $this->syncOriginal(); |
||
| 52 | |||
| 53 | return $this; |
||
| 54 | } |
||
| 56 |