|
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
|
|
|
|