Completed
Push — master ( 188ffb...31684b )
by Maxime
02:48
created

Reset::buildForm()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 33
rs 8.8571
cc 1
eloc 19
nc 1
nop 0
1
<?php namespace Distilleries\Expendable\Http\Forms\Login;
2
3
use Distilleries\FormBuilder\FormValidator;
4
5
class Reset extends FormValidator {
6
7
    public static $rules = [
8
        'email'    => 'required|email',
9
        'password' => 'required|min:8',
10
        'account'  => 'required',
11
        'token'    => 'required',
12
    ];
13
14
    public function buildForm()
15
    {
16
        $this
17
            ->add('token', 'hidden', [
18
                'default_value' => $this->getData('token')
19
            ])
20
            ->add('email', 'email',
21
                [
22
                    'label'      => trans('expendable::form.email'),
23
                    'validation' => 'required,custom[email]',
24
                    'attr'       => [
25
                        'class' => 'placeholder-no-fix',
26
                    ],
27
28
                ])
29
            ->add('password', 'password',
30
                [
31
                    'label'      => trans('expendable::form.password'),
32
                    'validation' => 'required'
33
                ])
34
            ->add('password_confirmation', 'password',
35
                [
36
                    'label'      => trans('expendable::form.repeat_password'),
37
                    'validation' => 'required,equals[password]'
38
                ])
39
            ->add('send', 'submit',
40
                [
41
                    'label' => trans('expendable::form.send'),
42
                    'attr'  => [
43
                        'class' => 'btn green-haze pull-right'
44
                    ],
45
                ]);
46
    }
47
}