| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 19 | public function toArray($request) |
||
| 20 | { |
||
| 21 | if ($is_admin = Str::of($this->creatable_type)->contains('Ministry')) { |
||
|
|
|||
| 22 | $avatar = ImageHelper::getImage('profile', $this->creatable->image, config('faithgen-sdk.ministries-server')); |
||
| 23 | } else { |
||
| 24 | $avatar = ImageHelper::getImage('users', $this->creatable->image, config('faithgen-sdk.users-server')); |
||
| 25 | } |
||
| 26 | |||
| 27 | return [ |
||
| 28 | 'id' => $this->id, |
||
| 29 | 'comment' => $this->comment, |
||
| 30 | 'creator' => [ |
||
| 31 | 'id' => $this->creatable->id, |
||
| 32 | 'name' => $this->creatable->name, |
||
| 33 | 'is_admin' => $is_admin, |
||
| 34 | 'avatar' => $avatar, |
||
| 35 | ], |
||
| 36 | 'date' => Helper::getDates($this->created_at), |
||
| 37 | ]; |
||
| 40 |