Completed
Push — master ( 8fcc32...ae3918 )
by Innocent
01:13
created

Discussion::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Faithgen\Discussions\Http\Resources;
4
5
class Discussion extends DiscussionList
6
{
7
    public function toArray($request)
8
    {
9
        return array_merge(parent::toArray($request), [
10
            'discussion' => $this->discussion,
11
            'url'        => $this->url,
12
            'comments'   => [
13
                'count' => $this->comments()->count(),
14
            ],
15
            'images'     => Image::collection($this->images),
16
        ]);
17
    }
18
}
19