Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function toArray($request) |
||
17 | { |
||
18 | return [ |
||
19 | 'id' => $this->id, |
||
|
|||
20 | 'name' => $this->original_name, |
||
21 | 'size' => $this->size, |
||
22 | 'mimeType' => $this->mime_type, |
||
23 | 'type' => $this->type(), |
||
24 | 'owner' => new User($this->whenLoaded('createdBy')), |
||
25 | 'isDestroyable' => $this->destroyableBy($request->user()), |
||
26 | 'isShareable' => $this->shareableBy($request->user()), |
||
27 | 'isViewable' => $this->viewableBy($request->user()), |
||
28 | 'createdAt' => $this->created_at->toDatetimeString(), |
||
29 | ]; |
||
32 |