Completed
Push — master ( 36a173...8ba542 )
by wen
15:06
created

Images::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Sco\Admin\Form\Elements;
4
5
class Images extends File
6
{
7
    protected $type = 'images';
8
9
    protected $listType = 'picture';
10
11
    public function getListType()
12
    {
13
        return $this->listType;
14
    }
15
16
    public function cardListType()
17
    {
18
        $this->listType = 'picture-card';
19
20
        return $this;
21
    }
22
23
    protected function getDefaultExtensions()
24
    {
25
        return config('admin.upload.extensions.image');
26
    }
27
28
    public function toArray()
29
    {
30
        return parent::toArray() + [
31
                'listType' => $this->getListType(),
32
            ];
33
    }
34
}
35