Passed
Pull Request — master (#77)
by Ron
41:51 queued 13:39
created

FormGroupServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 37
ccs 14
cts 14
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 20 1
A register() 0 2 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Form;
7
8
class FormGroupServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register services.
12
     *
13
     * @return void
14
     */
15 750
    public function register()
16
    {
17
        //
18 750
    }
19
20
    /**
21
     * Bootstrap services.
22
     *
23
     * @return void
24
     */
25 750
    public function boot()
26
    {
27
        //  Service provider to customize form inputs
28 750
        Form::component('bsText',     'components.form.text',     ['name', 'label', 'value' => null, 'attributes' => []]);
29 750
        Form::component('bsPassword', 'components.form.password', ['name', 'label', 'value' => null, 'attributes' => []]);
30 750
        Form::component('bsNumber',   'components.form.number',   ['name', 'label', 'value' => null, 'attributes' => []]);
31 750
        Form::component('bsEmail',    'components.form.email',    ['name', 'label', 'value' => null, 'attributes' => []]);
32 750
        Form::component('bsDate',     'components.form.date',     ['name', 'label', 'value' => null, 'attributes' => []]);
33 750
        Form::component('bsTextarea', 'components.form.textarea', ['name', 'label', 'value' => null, 'attributes' => []]);
34 750
        Form::component('bsCheckbox', 'components.form.checkbox', ['name', 'label', 'value' => 'on', 'checked' => false, 'attributes' => []]);
35 750
        Form::component('bsSelect',   'components.form.select',   ['name', 'label', 'list', 'selected' => null, 'attributes' => []]);
36
37
        //  Custom Submit button
38 750
        Form::component('bsSubmit', 'components.form.submit', ['name']);
39
40
        //  List of all states in a dropdown box
41 750
        Form::component('allStates', 'components.form.allStates', ['default' => null]);
42
43
        //  List of all timezones in a dropdown box
44 750
        Form::component('bsTimeZone', 'components.form.timezone', ['default' => config('app.timezone')]);
45 750
    }
46
}
47