Passed
Push — master ( 2f9400...3b53b3 )
by Iman
03:25
created

DefaultFormConfigs::defaultConfigForFields()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 28
nc 1
nop 1
dl 0
loc 36
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace crocodicstudio\crudbooster\Modules\ModuleGenerator\ControllerGenerator;
4
5
class DefaultFormConfigs
6
{
7
    /**
8
     * @param $table
9
     * @return array
10
     */
11
    public static function defaultConfigForFields($table)
12
    {
13
        return [
14
            'isPassword' => [
15
                'type' => 'password',
16
                'validation' => 'min:5|max:32|required',
17
                'help' => cbTrans("text_default_help_password"),
18
            ],
19
            'isImage' => [
20
                'type' => 'upload',
21
                'validation' => 'required|image',
22
                'help' => cbTrans('text_default_help_upload'),
23
            ],
24
            'isGeographical' => [
25
                'type' => 'hidden',
26
                'validation' => 'required|numeric',
27
            ],
28
            'isPhone' => [
29
                'type' => 'number',
30
                'validation' => 'required|numeric',
31
                'placeholder' => cbTrans('text_default_help_number'),
32
            ],
33
            'isEmail' => [
34
                'type' => 'email',
35
                'validation' => 'require|email|unique:'.$table,
36
                'placeholder' => cbTrans('text_default_help_email'),
37
            ],
38
            'isNameField' => [
39
                'type' => 'text',
40
                'validation' => 'required|string|min:3|max:70',
41
                'placeholder' => cbTrans('text_default_help_text'),
42
            ],
43
            'isUrlField' => [
44
                'type' => 'text',
45
                'validation' => 'required|url',
46
                'placeholder' => cbTrans('text_default_help_url'),
47
            ],
48
        ];
49
    }
50
}