Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function toArray($request) |
||
16 | { |
||
17 | return [ |
||
18 | 'type' => 'message', |
||
19 | 'id' => (string) $this->id, |
||
|
|||
20 | 'attributes' => [ |
||
21 | 'thread_id' => $this->thread_id, |
||
22 | 'thread' => new ThreadResource($this->whenLoaded('tread')), |
||
23 | 'user_id' => $this->user_id, |
||
24 | 'user' => new UserResource($this->whenLoaded('user')), |
||
25 | 'body' => $this->body, |
||
26 | 'created_at' => $this->created_at, |
||
27 | 'updated_at' => $this->updated_at, |
||
28 | ], |
||
32 |