FormServiceProvider.php
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
namespace App\Providers;
use Form;
use Illuminate\Support\ServiceProvider;
class FormServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Form components
Form::component('textGroup', 'partials.form.text_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('emailGroup', 'partials.form.email_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('passwordGroup', 'partials.form.password_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('numberGroup', 'partials.form.number_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('selectGroup', 'partials.form.select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6',
]);
Form::component('textareaGroup', 'partials.form.textarea_group', [
'name', 'text', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12',
]);
Form::component('radioGroup', 'partials.form.radio_group', [
'name', 'text', 'enable' => trans('general.yes'), 'disable' => trans('general.no'), 'attributes' => [], 'col' => 'col-md-6',
]);
Form::component('checkboxGroup', 'partials.form.checkbox_group', [
'name', 'text', 'items' => [], 'value' => 'name', 'id' => 'id', 'attributes' => ['required' => 'required'], 'col' => 'col-md-12',
]);
Form::component('fileGroup', 'partials.form.file_group', [
'name', 'text', 'attributes' => [], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('deleteButton', 'partials.form.delete_button', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Form::component('deleteLink', 'partials.form.delete_link', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Form::component('saveButtons', 'partials.form.save_buttons', [
'cancel', 'col' => 'col-md-12',
]);
Form::component('recurring', 'partials.form.recurring', [
'page', 'model' => null,
]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}