Test Failed
Pull Request — main (#21)
by
unknown
07:08 queued 03:25
created

GroupFieldServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 16
c 0
b 0
f 0
dl 0
loc 49
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 31 1
1
<?php
2
3
namespace Hafijul233\Form\Providers;
4
5
use Hafijul233\Form\Facades\Form;
6
use Illuminate\Support\Facades\Config;
7
use Illuminate\Support\ServiceProvider;
8
9
/**
10
 * Class GroupFieldServiceProvider
11
 */
12
class GroupFieldServiceProvider extends ServiceProvider
13
{
14
    /**
15
     * Load All Normal Bootstrap Style Forms
16
     *
17
     * Example:
18
     *
19
     * Label
20
     *  +-----------------------------------+
21
     *  | icon |       Field                |
22
     *  +-----------------------------------+
23
     *
24
     *                  OR
25
     * Label
26
     *  +-----------------------------------+
27
     *  |              Field         | icon |
28
     *  +-----------------------------------+
29
     */
30
    public function boot()
31
    {
32
        $style = Config::get('form.style', 'bootstrap4');
33
34
        Form::component('gText', 'form::'.$style.'.group.text', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
35
36
        Form::component('gEmail', 'form::'.$style.'.group.email', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
37
38
        Form::component('gPassword', 'form::'.$style.'.group.password', ['name', 'label', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
39
40
        Form::component('gSearch', 'form::'.$style.'.group.search', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
41
42
        Form::component('gTel', 'form::'.$style.'.group.tel', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
43
44
        Form::component('gNumber', 'form::'.$style.'.group.number', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
45
46
        Form::component('gDate', 'form::'.$style.'.group.date', ['name', 'label', 'default' => date('Y-m-d'), 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
47
48
        Form::component('gUrl', 'form::'.$style.'.group.url', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
49
50
        Form::component('gTextarea', 'form::'.$style.'.group.textarea', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
51
52
        Form::component('gSelect', 'form::'.$style.'.group.select', ['name', 'label', 'data', 'selected', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
53
54
        Form::component('gSelectMulti', 'form::'.$style.'.group.selectmulti', ['name', 'label', 'data' => [], 'selected' => [], 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
55
56
        Form::component('gSelectRange', 'form::'.$style.'.group.selectrange', ['name', 'label', 'begin', 'end', 'selected', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
57
58
        Form::component('gSelectDay', 'form::'.$style.'.group.selectday', ['name', 'label', 'selected' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
59
60
        Form::component('gSelectMonth', 'form::'.$style.'.group.selectmonth', ['name', 'label', 'selected' => date('m'), 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]);
61
    }
62
}
63