|
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 HorizontalFieldServiceProvider |
|
11
|
|
|
*/ |
|
12
|
|
|
class HorizontalFieldServiceProvider extends ServiceProvider |
|
13
|
|
|
{ |
|
14
|
|
|
public function boot() |
|
15
|
|
|
{ |
|
16
|
|
|
$style = Config::get('form.style', 'bootstrap4'); |
|
17
|
|
|
|
|
18
|
|
|
Form::component('hText', 'form::'.$style.'.horizon.text', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
19
|
|
|
|
|
20
|
|
|
Form::component('hEmail', 'form::'.$style.'.horizon.email', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
21
|
|
|
|
|
22
|
|
|
Form::component('hPassword', 'form::'.$style.'.horizon.password', ['name', 'label', 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
23
|
|
|
|
|
24
|
|
|
Form::component('hRange', 'form::'.$style.'.horizon.range', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
25
|
|
|
|
|
26
|
|
|
Form::component('hSearch', 'form::'.$style.'.horizon.search', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
27
|
|
|
|
|
28
|
|
|
Form::component('hTel', 'form::'.$style.'.horizon.tel', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
29
|
|
|
|
|
30
|
|
|
Form::component('hNumber', 'form::'.$style.'.horizon.number', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
31
|
|
|
|
|
32
|
|
|
Form::component('hDate', 'form::'.$style.'.horizon.date', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
33
|
|
|
|
|
34
|
|
|
Form::component('hUrl', 'form::'.$style.'.horizon.url', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
35
|
|
|
|
|
36
|
|
|
Form::component('hFile', 'form::'.$style.'.horizon.file', ['name', 'label', 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
37
|
|
|
|
|
38
|
|
|
Form::component('hTextarea', 'form::'.$style.'.horizon.textarea', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
39
|
|
|
|
|
40
|
|
|
Form::component('hSelect', 'form::'.$style.'.horizon.select', ['name', 'label', 'data', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
41
|
|
|
|
|
42
|
|
|
Form::component('hSelectMulti', 'form::'.$style.'.horizon.selectmulti', ['name', 'label', 'data' => [], 'selected' => [], 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
43
|
|
|
|
|
44
|
|
|
Form::component('hSelectRange', 'form::'.$style.'.horizon.selectrange', ['name', 'label', 'begin', 'end', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
45
|
|
|
|
|
46
|
|
|
Form::component('hSelectMonth', 'form::'.$style.'.horizon.selectmonth', ['name', 'label', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
47
|
|
|
|
|
48
|
|
|
Form::component('hCheckbox', 'form::'.$style.'.horizon.checkbox', ['name', 'label', 'values' => [], 'checked' => [], 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
49
|
|
|
|
|
50
|
|
|
Form::component('hRadio', 'form::'.$style.'.horizon.radio', ['name', 'label', 'values' => [], 'checked' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|