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