Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function transform(Transaction $item) |
||
16 | { |
||
17 | return [ |
||
18 | 'id' => $item->id, |
||
19 | 'status' => [ |
||
20 | 'id' => $item->status->id, |
||
21 | 'name' => $item->status->name, |
||
22 | 'slug' => $item->status->slug |
||
23 | ], |
||
24 | 'type' => [ |
||
25 | 'id' => $item->type->id, |
||
26 | 'name' => $item->type->name, |
||
27 | 'slug' => $item->type->slug |
||
28 | ], |
||
29 | 'account_name' => $item->account_name, |
||
30 | 'to_account_name' => $item->to_account_name, |
||
31 | 'payee_name' => $item->payee_name, |
||
32 | 'category_name' => $item->category_name, |
||
33 | 'sub_category_name' => $item->sub_category_name, |
||
34 | 'amount' => round($item->amount, 2), |
||
35 | 'notes' => $item->notes, |
||
36 | 'created_at' => $item->created_at->toIso8601String(), |
||
37 | 'updated_at' => $item->updated_at->toIso8601String() |
||
38 | ]; |
||
39 | } |
||
40 | } |
||
41 |