| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 19 | public function transformData($model) |
||
| 20 | { |
||
| 21 | $user = array_only($model->toArray(), User::$includable); |
||
| 22 | |||
| 23 | if ($model->getAttribute('avatar')) { |
||
| 24 | $user['avatar'] = starts_with($model->avatar, 'http') ? $model->avatar : cdn('uploads/avatars/'.$model->avatar); |
||
| 25 | } |
||
| 26 | |||
| 27 | if ($model->getAttribute('links')) { |
||
| 28 | $user['links'] = [ |
||
| 29 | 'replies_web_view' => route('users.replies.web_view', $model->id), |
||
| 30 | ]; |
||
| 31 | } |
||
| 32 | |||
| 33 | return $user; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |