|
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 InlineFieldServiceProvider |
|
11
|
|
|
*/ |
|
12
|
|
|
class InlineFieldServiceProvider extends ServiceProvider |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Load All Inline Bootstrap Style Forms |
|
16
|
|
|
* |
|
17
|
|
|
* Example: |
|
18
|
|
|
* |
|
19
|
|
|
* +-----------------------------------+ |
|
20
|
|
|
* | Field | |
|
21
|
|
|
* +-----------------------------------+ |
|
22
|
|
|
*/ |
|
23
|
|
|
public function boot() |
|
24
|
|
|
{ |
|
25
|
|
|
$style = Config::get('form.style', 'bootstrap4'); |
|
26
|
|
|
|
|
27
|
|
|
Form::component('iText', 'form::'.$style.'.inline.text', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
28
|
|
|
|
|
29
|
|
|
Form::component('iEmail', 'form::'.$style.'.inline.email', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
30
|
|
|
|
|
31
|
|
|
Form::component('iPassword', 'form::'.$style.'.inline.password', ['name', 'label', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
32
|
|
|
|
|
33
|
|
|
Form::component('iRange', 'form::'.$style.'.inline.range', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]); |
|
34
|
|
|
|
|
35
|
|
|
Form::component('iSearch', 'form::'.$style.'.inline.search', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
36
|
|
|
|
|
37
|
|
|
Form::component('iTel', 'form::'.$style.'.inline.tel', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
38
|
|
|
|
|
39
|
|
|
Form::component('iNumber', 'form::'.$style.'.inline.number', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
40
|
|
|
|
|
41
|
|
|
Form::component('iDate', 'form::'.$style.'.inline.date', ['name', 'label', 'default' => date('Y-m-d'), 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
42
|
|
|
|
|
43
|
|
|
Form::component('iUrl', 'form::'.$style.'.inline.url', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
44
|
|
|
|
|
45
|
|
|
Form::component('iFile', 'form::'.$style.'.inline.file', ['name', 'label', 'required' => false, 'attributes' => []]); |
|
46
|
|
|
|
|
47
|
|
|
Form::component('iImage', 'form::'.$style.'.inline.image', ['name', 'label', 'required' => false, 'preview' => ['preview' => false, 'height' => 100, 'default' => '/img/logo-app.png'], 'attributes' => ['accept' => 'image/*']]); |
|
48
|
|
|
|
|
49
|
|
|
Form::component('iTextarea', 'form::'.$style.'.inline.textarea', ['name', 'label', 'default' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
50
|
|
|
|
|
51
|
|
|
Form::component('iSelect', 'form::'.$style.'.inline.select', ['name', 'label', 'data' => [], 'selected', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
52
|
|
|
|
|
53
|
|
|
Form::component('iSelectMulti', 'form::'.$style.'.inline.selectmulti', ['name', 'label', 'data' => [], 'selected' => [], 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
54
|
|
|
|
|
55
|
|
|
Form::component('iSelectRange', 'form::'.$style.'.inline.selectrange', ['name', 'label', 'begin', 'end', 'selected', 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
56
|
|
|
|
|
57
|
|
|
Form::component('iSelectMonth', 'form::'.$style.'.inline.selectmonth', ['name', 'label', 'selected' => null, 'required' => false, 'icon' => null, 'position' => 'before', 'attributes' => []]); |
|
58
|
|
|
|
|
59
|
|
|
Form::component('iCheckbox', 'form::'.$style.'.inline.checkbox', ['name', 'label', 'values' => [], 'checked' => [], 'required' => false, 'attributes' => []]); |
|
60
|
|
|
|
|
61
|
|
|
Form::component('iRadio', 'form::'.$style.'.inline.radio', ['name', 'label', 'values' => [], 'checked' => null, 'required' => false, 'attributes' => []]); |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|