Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function toArray($request) |
||
18 | { |
||
19 | $valueText = $this->new_value; |
||
|
|||
20 | if ($this->type === Stage::class) { |
||
21 | $valueText = Stage::find($this->new_value)->name; |
||
22 | } |
||
23 | |||
24 | return [ |
||
25 | 'created_at' => $this->created_at, |
||
26 | 'type' => $this->type, |
||
27 | 'prev_value' => $this->prev_value, |
||
28 | 'new_value' => $this->new_value, |
||
29 | 'new_value_text' => $valueText, |
||
30 | 'user' => [ |
||
31 | 'name' => $this->user->name, |
||
32 | ], |
||
36 |