├── UPGRADE.md
├── resources
├── css
│ └── app.css
├── js
│ └── app.js
└── views
│ ├── html
│ ├── horizon
│ │ ├── email.blade.php
│ │ ├── file.blade.php
│ │ ├── url.blade.php
│ │ ├── date.blade.php
│ │ ├── number.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── textarea.blade.php
│ │ ├── search.blade.php
│ │ ├── radio.blade.php
│ │ ├── select.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectrange.blade.php
│ │ └── selectyear.blade.php
│ ├── normal
│ │ ├── email.blade.php
│ │ ├── number.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── url.blade.php
│ │ ├── date.blade.php
│ │ ├── range.blade.php
│ │ ├── search.blade.php
│ │ ├── text.blade.php
│ │ ├── textarea.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── selectyear.blade.php
│ │ ├── radio.blade.php
│ │ ├── checkbox.blade.php
│ │ └── file.blade.php
│ ├── group
│ │ ├── checkbox.blade.php
│ │ ├── radio.blade.php
│ │ ├── url.blade.php
│ │ ├── range.blade.php
│ │ ├── search.blade.php
│ │ ├── textarea.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectyear.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── date.blade.php
│ │ ├── number.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── email.blade.php
│ │ └── file.blade.php
│ └── inline
│ │ ├── checkbox.blade.php
│ │ ├── radio.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectyear.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── range.blade.php
│ │ ├── url.blade.php
│ │ ├── search.blade.php
│ │ ├── textarea.blade.php
│ │ ├── date.blade.php
│ │ ├── number.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── email.blade.php
│ │ ├── text.blade.php
│ │ └── file.blade.php
│ ├── bootstrap5
│ ├── horizon
│ │ ├── date.blade.php
│ │ ├── email.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── url.blade.php
│ │ ├── number.blade.php
│ │ ├── search.blade.php
│ │ ├── textarea.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── selectmulti.blade.php
│ │ ├── range.blade.php
│ │ ├── radio.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── file.blade.php
│ │ └── image.blade.php
│ └── regular
│ │ ├── range.blade.php
│ │ ├── radio.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── file.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── url.blade.php
│ │ ├── date.blade.php
│ │ ├── search.blade.php
│ │ ├── email.blade.php
│ │ ├── number.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── textarea.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectyear.blade.php
│ │ ├── selectmulti.blade.php
│ │ └── image.blade.php
│ ├── bootstrap4
│ ├── horizon
│ │ ├── date.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── url.blade.php
│ │ ├── email.blade.php
│ │ ├── number.blade.php
│ │ ├── search.blade.php
│ │ ├── textarea.blade.php
│ │ ├── select.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── selectmulti.blade.php
│ │ ├── range.blade.php
│ │ ├── radio.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── file.blade.php
│ │ └── image.blade.php
│ └── regular
│ │ ├── range.blade.php
│ │ ├── radio.blade.php
│ │ ├── checkbox.blade.php
│ │ ├── file.blade.php
│ │ ├── password.blade.php
│ │ ├── tel.blade.php
│ │ ├── text.blade.php
│ │ ├── url.blade.php
│ │ ├── date.blade.php
│ │ ├── email.blade.php
│ │ ├── search.blade.php
│ │ ├── number.blade.php
│ │ ├── selectrange.blade.php
│ │ ├── select.blade.php
│ │ ├── textarea.blade.php
│ │ ├── selectmonth.blade.php
│ │ ├── selectyear.blade.php
│ │ ├── selectmulti.blade.php
│ │ └── image.blade.php
│ └── examples
│ ├── bootstrap5.blade.php
│ ├── html.blade.php
│ └── bootstrap4.blade.php
├── CHANGELOG.md
├── SECURITY.md
├── src
├── helpers.php
├── FormServiceProvider.php
├── Providers
│ ├── LabelServiceProvider.php
│ ├── HorizontalFieldServiceProvider.php
│ └── RegularFieldServiceProvider.php
├── Traits
│ ├── ComponentTrait.php
│ └── FormAccessibleTrait.php
└── Facades
│ └── Form.php
├── routes
└── web.php
├── LICENSE.md
├── config
└── form.php
├── composer.json
├── README.md
├── package.json
└── CODE_OF_CONDUCT.md
/UPGRADE.md:
--------------------------------------------------------------------------------
1 | 0.1.0
2 |
--------------------------------------------------------------------------------
/resources/css/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/email.blade.php:
--------------------------------------------------------------------------------
1 | field
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to `form` will be documented in this file.
4 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/file.blade.php:
--------------------------------------------------------------------------------
1 | {!! \Laraflow\Form\Facades\Form::hLabel($name, $label, $required) !!}
2 |
3 | @php
4 | $options = ['class' => 'form-control col-md-10'];
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::file($name, $default, $required, $attributes) !!}
12 |
--------------------------------------------------------------------------------
/resources/views/html/normal/email.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 | {!! \Laraflow\Form\Facades\Form::email($name, $default, $required, $attributes) !!}
11 |
12 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
13 |
14 |
--------------------------------------------------------------------------------
/resources/views/html/normal/number.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::number($name, $default, $required, $attributes) !!}
12 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
13 |
14 |
--------------------------------------------------------------------------------
/resources/views/html/normal/password.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::password($name, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/tel.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::tel($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/url.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::url($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/date.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::date($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/range.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::range($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/search.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::search($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/text.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::text($name, $default, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/group/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 |
6 | if (isset($required) && $required == true) {
7 | $options['required'] = 'required';
8 | }
9 | @endphp
10 |
11 | {!! \Laraflow\Form\Facades\Form::checkbox($name, $checked, $required, $attributes) !!}
12 |
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control', 'rows' => 3];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::textarea($name, $default, $required, $attributes) !!}
13 |
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/normal/select.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control custom-select'];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
13 |
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/normal/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control custom-select'];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::selectMonth($name, $selected, $required, $attributes) !!}
13 |
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/normal/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control custom-select'];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::selectRange($name, $begin, $end, $selected, $required, $attributes) !!}
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 |
--------------------------------------------------------------------------------
/resources/views/html/normal/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control custom-select'];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::selectYear($name, $begin, $end, $selected, $required, $attributes) !!}
13 |
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/inline/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class' => 'd-none']) !!}
3 |
4 | @php
5 | $options = ['class' => 'form-control', 'placeholder' => $attributes['placeholder'] ?? $label];
6 |
7 | if (isset($required) && $required == true) {
8 | $options['required'] = 'required';
9 | }
10 | @endphp
11 |
12 | {!! \Laraflow\Form\Facades\Form::checkbox($name, $checked, $required, $attributes) !!}
13 |
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/url.blade.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/date.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/number.blade.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/tel.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/text.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/search.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/date.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::date($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/email.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::email($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/password.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::password($name, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/tel.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::tel($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/text.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::text($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/url.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::url($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/date.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/password.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/tel.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/text.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/url.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/number.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::number($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/search.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 | {!! \Laraflow\Form\Facades\Form::search($name, $default, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/radio.blade.php:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/select.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/email.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/number.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/search.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/html/horizon/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/range.blade.php:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/resources/views/html/group/radio.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Custom radio
4 |
5 |
6 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
7 |
8 | @php
9 |
10 | if (isset($required) && $required == true) {
11 | $options['required'] = 'required';
12 | }
13 | @endphp
14 |
15 | {!! \Laraflow\Form\Facades\Form::radio($name, $checked, $required, $attributes) !!}
16 |
17 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
18 |
19 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 |
9 | | Version | Supported |
10 | | ------- | ------------------ |
11 | | 0.1.1 | :white_check_mark: |
12 | | 0.1.0 | :white_check_mark: |
13 | | 0.0.9 | :x: |
14 | | < 0.0.8 | :x: |
15 |
16 | ## Reporting a Vulnerability
17 |
18 | Use this section to tell people how to report a vulnerability.
19 |
20 | Tell them where to go, how often they can expect to get an update on a
21 | reported vulnerability, what to expect if the vulnerability is accepted or
22 | declined, etc.
23 |
--------------------------------------------------------------------------------
/resources/views/html/normal/radio.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Custom radio
4 |
5 |
6 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}
7 |
8 | @php
9 |
10 | if (isset($required) && $required == true) {
11 | $options['required'] = 'required';
12 | }
13 | @endphp
14 |
15 | {!! \Laraflow\Form\Facades\Form::radio($name, $checked, $required, $attributes) !!}
16 |
17 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/range.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
5 | @php $attributes['class'][] = 'custom-range' @endphp
6 |
7 | {!! \Laraflow\Form\Facades\Form::range($name, $default, $required, $attributes) !!}
8 |
9 | @if (isset($attributes['min']) && isset($attributes['max']))
10 |
11 |
{{ $attributes['min'] }}
12 |
{{ $attributes['max'] }}
13 |
14 | @endif
15 |
16 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control', 'rows' => 3];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::textarea($name, $default, $required, $attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/select.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-select'];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/helpers.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-select'];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-select'];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::selectMonth($name, $selected, $required, $attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-select'];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::selectRange($name, $begin, $end, $selected, $required, $attributes) !!}
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/resources/views/html/group/url.blade.php:
--------------------------------------------------------------------------------
1 |
23 |
--------------------------------------------------------------------------------
/resources/views/html/group/range.blade.php:
--------------------------------------------------------------------------------
1 |
23 |
--------------------------------------------------------------------------------
/resources/views/html/group/search.blade.php:
--------------------------------------------------------------------------------
1 |
23 |
--------------------------------------------------------------------------------
/resources/views/html/group/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
23 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/selectmulti.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-select', 'multiple' => 'multiple'];
8 | $options['id'] = $name;
9 |
10 | if (isset($required) && $required == true) {
11 | $options['required'] = 'required';
12 | }
13 | @endphp
14 |
15 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
16 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
17 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
18 |
19 |
20 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/selectmulti.blade.php:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/radio.blade.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/radio.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
3 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
4 | @php $attributes['class'][] = 'custom-control-input' @endphp
5 |
6 | @foreach ($values ?? [] as $value => $display)
7 | @php $attributes['id'] = $name . '-radio-' . $value @endphp
8 |
9 |
10 | {!! \Laraflow\Form\Facades\Form::radio($name, $value, $value == $checked, $required, $attributes) !!}
11 |
12 | {!! \Laraflow\Form\Facades\Form::label($attributes['id'], $display, false, ['class' => 'custom-control-label']) !!}
13 |
14 | @endforeach
15 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
16 |
17 |
--------------------------------------------------------------------------------
/resources/views/html/inline/radio.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Custom radio
4 |
5 |
6 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class' => 'd-none']) !!}
7 |
8 | @php
9 | $options = ['class' => 'form-control', 'placeholder' => $attributes['placeholder'] ?? $label];
10 |
11 | if (isset($required) && $required == true) {
12 | $options['required'] = 'required';
13 | }
14 | @endphp
15 |
16 | {!! \Laraflow\Form\Facades\Form::radio($name, $checked, $required, $attributes) !!}
17 |
18 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
19 |
20 |
--------------------------------------------------------------------------------
/resources/views/html/normal/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/resources/views/html/group/select.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/group/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/group/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/group/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/select.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/resources/views/html/inline/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | group(function () {
18 | Route::get('/form/examples', function () {
19 | if (App::environment('local') == true) {
20 | Artisan::call('view:clear');
21 | }
22 | $viewPath = Config::get('form.style', 'bootstrap4');
23 |
24 | return view("form::examples.{$viewPath}");
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
5 |
6 | @php $attributes['class'][] = 'custom-control-input' @endphp
7 |
8 | @foreach ($values as $value => $display)
9 | @php
10 | $attributes['id'] = "{$name}-checkbox-{$value}";
11 | @endphp
12 |
13 |
14 | {!! \Laraflow\Form\Facades\Form::checkbox($name, $value, in_array($value, $checked), $required, $attributes) !!}
15 |
16 | {!! \Laraflow\Form\Facades\Form::label($attributes['id'], $display, false, ['class' => 'custom-control-label']) !!}
17 |
18 | @endforeach
19 |
20 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
21 |
22 |
--------------------------------------------------------------------------------
/resources/views/html/inline/range.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/url.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/search.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/html/inline/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/examples/bootstrap5.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 | Hello, world!
14 |
15 |
16 |
17 | Hello, world!
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/range.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 |
6 | @php
7 | $options = ['class' => 'form-control custom-range '];
8 |
9 | if (isset($required) && $required == true) {
10 | $options['required'] = 'required';
11 | }
12 | @endphp
13 |
14 | {!! \Laraflow\Form\Facades\Form::range($name, $default, $required, $attributes) !!}
15 | @if (isset($attributes['min']) && isset($attributes['max']))
16 |
17 |
{{ $attributes['min'] }}
18 |
{{ $attributes['max'] }}
19 |
20 | @endif
21 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/range.blade.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/file.blade.php:
--------------------------------------------------------------------------------
1 |
26 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/file.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 |
5 | @php $attributes['class'][] = 'custom-file-input'; @endphp
6 | @php $attributes['id'] = $name; @endphp
7 |
8 |
9 | {!! \Laraflow\Form\Facades\Form::label('', 'Choose file...', false, [
10 | 'class' => 'custom-file-label',
11 | 'id' => $name . '_file_label',
12 | ]) !!}
13 | {!! \Laraflow\Form\Facades\Form::file($name, $required, $attributes) !!}
14 |
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 |
23 |
24 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
25 |
26 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/radio.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
4 | 'class' => 'col-form-label col-sm-' . $col_size,
5 | ]) !!}
6 |
7 | @php
8 | $options = ['class' => 'custom-control-input '];
9 |
10 | if (isset($required) && $required == true) {
11 | $options['required'] = 'required';
12 | }
13 | @endphp
14 |
15 | @foreach ($values as $value => $display)
16 | @php
17 | $id = $name . '-radio-' . $value;
18 | $options['id'] = $id;
19 | @endphp
20 |
21 |
22 | {!! \Laraflow\Form\Facades\Form::radio($name, $value, $value == $checked, $required, $attributes) !!}
23 |
24 | {!! \Laraflow\Form\Facades\Form::label($id, $display, false, ['class' => 'custom-control-label']) !!}
25 |
26 | @endforeach
27 |
28 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
29 |
30 |
31 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/radio.blade.php:
--------------------------------------------------------------------------------
1 |
31 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
4 | 'class' => 'col-form-label col-sm-' . $col_size,
5 | ]) !!}
6 |
7 | @php
8 | $options = ['class' => 'custom-control-input '];
9 |
10 | if (isset($required) && $required == true) {
11 | $options['required'] = 'required';
12 | }
13 | @endphp
14 |
15 |
16 | @foreach ($values as $value => $display)
17 | @php
18 | $id = $name . '-checkbox-' . $value;
19 | $options['id'] = $id;
20 | @endphp
21 |
22 |
23 | {!! \Laraflow\Form\Facades\Form::checkbox($name, $value, in_array($value, $checked), $required, $attributes) !!}
24 |
25 | {!! \Laraflow\Form\Facades\Form::label($id, $display, false, ['class' => 'custom-control-label']) !!}
26 |
27 | @endforeach
28 |
29 | {!! \Laraflow\Form\Facades\Form::error($name . '[]') !!}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Mohammad Hafijul Islam
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/checkbox.blade.php:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/resources/views/html/group/date.blade.php:
--------------------------------------------------------------------------------
1 |
33 |
--------------------------------------------------------------------------------
/resources/views/html/group/number.blade.php:
--------------------------------------------------------------------------------
1 |
33 |
--------------------------------------------------------------------------------
/resources/views/html/group/password.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/html/group/tel.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/html/group/text.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/html/group/email.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/html/inline/date.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/file.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => 'col-form-label col-sm-' . $col_size,
4 | ]) !!}
5 | @php
6 | $options = ['class' => 'form-control custom-file-input '];
7 |
8 | if (isset($required) && $required == true) {
9 | $options['required'] = 'required';
10 | }
11 | @endphp
12 |
13 |
14 | {!! \Laraflow\Form\Facades\Form::label('', 'Choose file...', false, [
15 | 'class' => 'custom-file-label',
16 | 'id' => $name . '_file_label',
17 | ]) !!}
18 | {!! \Laraflow\Form\Facades\Form::file($name, $required, $attributes) !!}
19 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
20 |
21 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
22 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/resources/views/html/inline/number.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/html/inline/password.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/html/inline/tel.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/file.blade.php:
--------------------------------------------------------------------------------
1 |
31 |
--------------------------------------------------------------------------------
/resources/views/html/inline/email.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/html/inline/text.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/html/group/file.blade.php:
--------------------------------------------------------------------------------
1 |
33 |
--------------------------------------------------------------------------------
/resources/views/html/inline/file.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/password.blade.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/tel.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/text.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/url.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/password.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @if (isset($attributes['icon']))
5 |
28 | @else
29 | {!! \Laraflow\Form\Facades\Form::password($name, $required, $attributes) !!}
30 | @endif
31 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
32 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
33 |
34 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/date.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/email.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/search.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/number.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/tel.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @if (isset($attributes['icon']))
5 |
28 | @else
29 | {!! \Laraflow\Form\Facades\Form::tel($name, $default, $required, $attributes) !!}
30 | @endif
31 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
32 |
33 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/text.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @if (isset($attributes['icon']))
5 |
28 | @else
29 | {!! \Laraflow\Form\Facades\Form::text($name, $default, $required, $attributes) !!}
30 | @endif
31 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
32 |
33 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/url.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @if (isset($attributes['icon']))
5 |
28 | @else
29 | {!! \Laraflow\Form\Facades\Form::url($name, $default, $required, $attributes) !!}
30 | @endif
31 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
32 |
33 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/date.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 |
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::date($name, $default, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/search.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @if (isset($attributes['icon']))
5 |
28 | @else
29 | {!! \Laraflow\Form\Facades\Form::search($name, $default, $required, $attributes) !!}
30 | @endif
31 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
32 |
33 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/email.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 |
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::email($name, $default, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/number.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 |
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::number($name, $default, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/selectrange.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['class'][] = 'custom-select' @endphp
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::selectRange($name, $begin, $end, $selected, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
34 |
35 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/select.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/textarea.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['rows'] = $attributes['rows'] ?? 3 @endphp
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::textarea($name, $default, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/select.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['class'][] = 'custom-select' @endphp
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/selectmonth.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['class'][] = 'custom-select' @endphp
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::selectMonth($name, $selected, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/selectyear.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['class'][] = 'custom-select' @endphp
5 | @if (isset($attributes['icon']))
6 |
29 | @else
30 | {!! \Laraflow\Form\Facades\Form::selectYear($name, $begin, $end, $selected, $required, $attributes) !!}
31 | @endif
32 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
33 |
34 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
35 |
36 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/selectmulti.blade.php:
--------------------------------------------------------------------------------
1 |
38 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/selectmulti.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 | @php $attributes['class'][] = 'custom-select' @endphp
5 | @php $attributes['multiple'] = 'multiple' @endphp
6 |
7 | @if (isset($attributes['icon']))
8 |
31 | @else
32 | {!! \Laraflow\Form\Facades\Form::select($name, $data, $selected, $required, $attributes) !!}
33 | @endif
34 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
35 |
36 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
37 |
38 |
--------------------------------------------------------------------------------
/resources/views/examples/html.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Bootstrap 101 Template
10 |
11 |
12 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 | Hello, world!
25 |
26 |
27 |
30 |
31 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/config/form.php:
--------------------------------------------------------------------------------
1 | env('FORM_STYLE', 'bootstrap4'),
13 |
14 | 'styles' => [
15 | 'bootstrap4' => [
16 | 'wrapper' => [
17 | 'normal' => 'form-group',
18 | 'group' => 'form-group',
19 | 'horizon' => 'form-group row',
20 | 'inline' => 'form-inline',
21 | ],
22 | 'field' => ['form-control'],
23 | 'validation' => ['is-invalid'], // if validation false color class
24 | 'error' => ['d-block invalid-feedback'], // if validation false color class
25 | 'submit' => ['btn btn-primary', 'font-weight-bold'],
26 | 'cancel' => ['invalid-feedback'],
27 | 'horizon_label_size' => '2',
28 | ],
29 | ],
30 |
31 | /**
32 | * Form month values what value and label month dropdown
33 | * will have
34 | *
35 | * @var array month
36 | */
37 | 'months' => [
38 | '1' => 'January',
39 | '2' => 'February',
40 | '3' => 'March',
41 | '4' => 'April',
42 | '5' => 'May',
43 | '6' => 'June',
44 | '7' => 'July',
45 | '8' => 'August',
46 | '9' => 'September',
47 | '10' => 'October',
48 | '11' => 'November',
49 | '12' => 'December',
50 | ],
51 |
52 | /**
53 | * Form day values what value and label day dropdown
54 | * will have
55 | *
56 | * @var array month
57 | */
58 | 'days' => [
59 | '1' => 'Saturday',
60 | '2' => 'Sunday',
61 | '3' => 'Monday',
62 | '4' => 'Tuesday',
63 | '5' => 'Wednesday',
64 | '6' => 'Thursday',
65 | '7' => 'Friday',
66 | ],
67 | ];
68 |
--------------------------------------------------------------------------------
/src/FormServiceProvider.php:
--------------------------------------------------------------------------------
1 | loadRoutesFrom(__DIR__.'/../routes/web.php');
24 |
25 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'form');
26 |
27 | $this->publishes([__DIR__.'/../config/form.php' => config_path('form.php')], 'form-config');
28 |
29 | $this->publishes([__DIR__.'/../resources/dist' => public_path('vendor/form')], 'form-assets');
30 |
31 | $this->publishes([__DIR__.'/../resources/views' => resource_path('views/vendor/form')], 'form-view');
32 | }
33 |
34 | /**
35 | * Register the service provider.
36 | *
37 | * @return void
38 | */
39 | public function register()
40 | {
41 | $this->mergeConfigFrom(__DIR__.'/../config/form.php', 'form');
42 |
43 | $this->app->singleton('form', function ($app) {
44 | $form = new FormBuilder($app['view'], $app['session.store']->token(), $app['url'], $app['request']);
45 |
46 | return $form->setSessionStore($app['session.store']);
47 | });
48 |
49 | $this->app->alias('form', FormBuilder::class);
50 |
51 | $this->app->register(LabelServiceProvider::class);
52 | $this->app->register(HorizontalFieldServiceProvider::class);
53 | $this->app->register(RegularFieldServiceProvider::class);
54 | }
55 |
56 | public function provides()
57 | {
58 | return ['form', FormBuilder::class];
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/Providers/LabelServiceProvider.php:
--------------------------------------------------------------------------------
1 | "col-md-{$col_size} col-form-label"], $options), false);
43 | });
44 |
45 | Form::macro('fLabel', function ($name, $value, $required = false, $options = []) {
46 | return str_replace('label', 'span', Form::label($name, $value, $required, $options, false));
47 | });
48 |
49 | Form::macro('hint', function (array $options = []) {
50 | if (! empty($options['hint'])) {
51 | return new HtmlString("{$options['hint']} ");
52 | }
53 | });
54 |
55 | /* Form::macro('nCancel', function ($title, $options = []) {
56 | $attributes = array_merge($options, ['class' => 'btn btn-danger fw-bold']);
57 |
58 | return Html::link(' ' . $title, $attributes, null, false);
59 | });*/
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/resources/views/html/normal/file.blade.php:
--------------------------------------------------------------------------------
1 |
50 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/regular/image.blade.php:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/regular/image.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, ['class'=>'form-label']) !!}
4 |
5 | @php $attributes['class'][] = 'custom-file-input'; @endphp
6 | @php $attributes['id'] = $name; @endphp
7 |
8 |
9 | {!! \Laraflow\Form\Facades\Form::label('', 'Choose file...', false, [
10 | 'class' => 'custom-file-label',
11 | 'id' => $name . '_file_label',
12 | ]) !!}
13 | {!! \Laraflow\Form\Facades\Form::file($name, $required, $attributes) !!}
14 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
15 |
16 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
17 | @if ($preview['preview'] ?? false)
18 |
19 |
20 |
21 |
35 | @endif
36 |
46 |
47 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
48 |
49 |
--------------------------------------------------------------------------------
/resources/views/bootstrap5/horizon/image.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {!! \Laraflow\Form\Facades\Form::label($name, $label, $required, [
3 | 'class' => ['col-form-label col-sm-' . $col_size],
4 | ]) !!}
5 | @php $attributes['class'][] = 'custom-file-input'; @endphp
6 |
7 |
8 | {!! \Laraflow\Form\Facades\Form::label('', 'Choose file...', false, [
9 | 'class' => 'custom-file-label',
10 | 'id' => $name . '_file_label',
11 | ]) !!}
12 | {!! \Laraflow\Form\Facades\Form::file($name, $required, $attributes) !!}
13 | {!! \Laraflow\Form\Facades\Form::error($name) !!}
14 |
15 | {!! \Laraflow\Form\Facades\Form::hint($attributes) !!}
16 |
17 | @if ($preview['preview'] ?? false)
18 |
19 |
21 |
22 |
36 | @endif
37 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/resources/views/bootstrap4/horizon/image.blade.php:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laraflow/form",
3 | "type": "library",
4 | "description": "Laravel form builder library based bootstrap form components",
5 | "support": {
6 | "issues": "https://github.com/laraflow/form/issues",
7 | "wiki": "https://github.com/laraflow/form/wiki",
8 | "source": "https://github.com/laraflow/form",
9 | "docs": "https://laraflow.github.io/form"
10 | },
11 | "keywords": [
12 | "framework",
13 | "laravel",
14 | "form",
15 | "bootstrap",
16 | "components",
17 | "php-form"
18 | ],
19 | "license": "MIT",
20 | "authors": [
21 | {
22 | "name": "Hafijul Islam",
23 | "email": "hafijul233@gmail.com",
24 | "homepage": "https://www.hafijulislam.me",
25 | "role": "Maintainer"
26 | }
27 | ],
28 | "require": {
29 | "php": "^7.2|^8.1",
30 | "illuminate/http": "*",
31 | "illuminate/routing": "*",
32 | "illuminate/session": "*",
33 | "illuminate/support": "*",
34 | "illuminate/view": "*"
35 | },
36 | "require-dev": {
37 | "mockery/mockery": "^1.0",
38 | "nunomaduro/collision": "^4.0|^5.0|^6.0",
39 | "nunomaduro/larastan": "^1.0",
40 | "orchestra/testbench": "^5.0|^6.0|^7.0",
41 | "phpstan/extension-installer": "^1.1",
42 | "phpstan/phpstan-deprecation-rules": "^1.0",
43 | "phpstan/phpstan-phpunit": "^1.1",
44 | "phpunit/phpunit": "^8.0|^9.0|^10.0"
45 | },
46 | "autoload": {
47 | "psr-4": {
48 | "Laraflow\\Form\\": "./src"
49 | },
50 | "files": [
51 | "./src/helpers.php"
52 | ]
53 | },
54 | "autoload-dev": {
55 | "psr-4": {
56 | "Laraflow\\Form\\Tests\\": "tests"
57 | }
58 | },
59 | "scripts": {
60 | "analyse": "vendor/bin/phpstan analyse",
61 | "test" : "vendor/bin/phpunit"
62 | },
63 | "config": {
64 | "sort-packages": true,
65 | "allow-plugins": {
66 | "pestphp/pest-plugin": true,
67 | "phpstan/extension-installer": true
68 | }
69 | },
70 | "extra": {
71 | "laravel": {
72 | "providers": [
73 | "Laraflow\\Form\\FormServiceProvider"
74 | ],
75 | "aliases": {
76 | "Form": "Laraflow\\Form\\Facades\\Form"
77 | }
78 | }
79 | },
80 | "minimum-stability": "dev",
81 | "prefer-stable": true
82 | }
83 |
--------------------------------------------------------------------------------
/resources/views/examples/bootstrap4.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
16 |
17 | Bootstrap 4 Examples
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
35 |
36 |
37 |
39 | @include('form::examples.bootstrap4.regular')
40 |
41 |
42 | @include('form::examples.bootstrap4.horizon')
43 |
44 |
45 |
46 |
47 |
48 |
51 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/Traits/ComponentTrait.php:
--------------------------------------------------------------------------------
1 | renderComponent($method, $parameters);
45 | }
46 |
47 | throw new BadMethodCallException("Method {$method} does not exist.");
48 | }
49 |
50 | /**
51 | * Check if a component is registered.
52 | */
53 | public static function hasComponent($name): bool
54 | {
55 | return isset(static::$components[$name]);
56 | }
57 |
58 | /**
59 | * Render a custom component.
60 | *
61 | * @return View|HtmlString
62 | */
63 | protected function renderComponent($name, array $arguments)
64 | {
65 | $component = static::$components[$name];
66 | $data = $this->getComponentData($component['signature'], $arguments);
67 |
68 | return new HtmlString(
69 | $this->view->make($component['view'], $data)->render()
70 | );
71 | }
72 |
73 | /**
74 | * Prepare the component data, while respecting provided defaults.
75 | *
76 | * @return array
77 | */
78 | protected function getComponentData(array $signature, array $arguments)
79 | {
80 | $data = [];
81 |
82 | $i = 0;
83 | foreach ($signature as $variable => $default) {
84 | // If the "variable" value is actually a numeric key, we can assume that
85 | // no default had been specified for the component argument and we'll
86 | // just use null instead, so that we can treat them all the same.
87 | if (is_numeric($variable)) {
88 | $variable = $default;
89 | $default = null;
90 | }
91 |
92 | $data[$variable] = Arr::get($arguments, $i, $default);
93 |
94 | $i++;
95 | }
96 |
97 | return $data;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/Traits/FormAccessibleTrait.php:
--------------------------------------------------------------------------------
1 | getAttributeFromArray($key);
27 |
28 | // If the attribute is listed as a date, we will convert it to a DateTime
29 | // instance on retrieval, which makes it quite convenient to work with
30 | // date fields without having to create a mutator for each property.
31 | if (in_array($key, $this->getDates())) {
32 | if (! is_null($value)) {
33 | $value = $this->asDateTime($value);
34 | }
35 | }
36 |
37 | // If the attribute has a get mutator, we will call that then return what
38 | // it returns as the value, which is useful for transforming values on
39 | // retrieval from the model to a form that is more useful for usage.
40 | if ($this->hasFormMutator($key)) {
41 | return $this->mutateFormAttribute($key, $value);
42 | }
43 |
44 | $keys = explode('.', $key);
45 |
46 | if ($this->isNestedModel($keys[0])) {
47 | $relatedModel = $this->getRelation($keys[0]);
48 |
49 | unset($keys[0]);
50 | $key = implode('.', $keys);
51 |
52 | if (method_exists($relatedModel, 'hasFormMutator') && $key !== '' && $relatedModel->hasFormMutator($key)) {
53 | return $relatedModel->getFormValue($key);
54 | }
55 |
56 | return data_get($relatedModel, empty($key) ? null : $key);
57 | }
58 |
59 | // No form mutator, let the model resolve this
60 | return data_get($this, $key);
61 | }
62 |
63 | public function hasFormMutator(string $key): bool
64 | {
65 | $methods = $this->getReflection()->getMethods(ReflectionMethod::IS_PUBLIC);
66 |
67 | $mutator = collect($methods)
68 | ->first(function (ReflectionMethod $method) use ($key) {
69 | return $method->getName() === 'form'.Str::studly($key).'Attribute';
70 | });
71 |
72 | return (bool) $mutator;
73 | }
74 |
75 | /**
76 | * Get a ReflectionClass Instance
77 | */
78 | protected function getReflection(): ReflectionClass
79 | {
80 | if (! $this->reflection) {
81 | $this->reflection = new ReflectionClass($this);
82 | }
83 |
84 | return $this->reflection;
85 | }
86 |
87 | /**
88 | * @return mixed
89 | */
90 | private function mutateFormAttribute($key, $value)
91 | {
92 | return $this->{'form'.Str::studly($key).'Attribute'}($value);
93 | }
94 |
95 | /**
96 | * Check for a nested model.
97 | */
98 | public function isNestedModel(string $key): bool
99 | {
100 | return in_array($key, array_keys($this->getRelations()));
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/src/Providers/HorizontalFieldServiceProvider.php:
--------------------------------------------------------------------------------
1 | null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
26 |
27 | Form::component('hEmail', 'form::'.$style.'.horizon.email', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
28 |
29 | Form::component('hPassword', 'form::'.$style.'.horizon.password', ['name', 'label', 'required' => false, 'col_size' => 2, 'attributes' => []]);
30 |
31 | Form::component('hRange', 'form::'.$style.'.horizon.range', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
32 |
33 | Form::component('hSearch', 'form::'.$style.'.horizon.search', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
34 |
35 | Form::component('hTel', 'form::'.$style.'.horizon.tel', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
36 |
37 | Form::component('hNumber', 'form::'.$style.'.horizon.number', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
38 |
39 | Form::component('hDate', 'form::'.$style.'.horizon.date', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
40 |
41 | Form::component('hUrl', 'form::'.$style.'.horizon.url', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
42 |
43 | Form::component('hFile', 'form::'.$style.'.horizon.file', ['name', 'label', 'required' => false, 'col_size' => 2, 'attributes' => []]);
44 |
45 | Form::component('hImage', 'form::'.$style.'.horizon.image', ['name', 'label', 'required' => false, 'col_size' => 2, 'preview' => ['preview' => false, 'height' => 100, 'default' => '/img/logo-app.png'], 'attributes' => ['accept' => 'image/*']]);
46 |
47 | Form::component('hTextarea', 'form::'.$style.'.horizon.textarea', ['name', 'label', 'default' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
48 |
49 | Form::component('hSelect', 'form::'.$style.'.horizon.select', ['name', 'label', 'data', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
50 |
51 | Form::component('hSelectMulti', 'form::'.$style.'.horizon.selectmulti', ['name', 'label', 'data' => [], 'selected' => [], 'required' => false, 'col_size' => 2, 'attributes' => []]);
52 |
53 | Form::component('hSelectRange', 'form::'.$style.'.horizon.selectrange', ['name', 'label', 'begin', 'end', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
54 |
55 | Form::component('hSelectMonth', 'form::'.$style.'.horizon.selectmonth', ['name', 'label', 'selected' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
56 |
57 | Form::component('hCheckbox', 'form::'.$style.'.horizon.checkbox', ['name', 'label', 'values' => [], 'checked' => [], 'required' => false, 'col_size' => 2, 'attributes' => []]);
58 |
59 | Form::component('hRadio', 'form::'.$style.'.horizon.radio', ['name', 'label', 'values' => [], 'checked' => null, 'required' => false, 'col_size' => 2, 'attributes' => []]);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/Providers/RegularFieldServiceProvider.php:
--------------------------------------------------------------------------------
1 | null, 'required' => false, 'attributes' => []]);
36 |
37 | Form::component('rEmail', 'form::'.$style.'.regular.email', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
38 |
39 | Form::component('rPassword', 'form::'.$style.'.regular.password', ['name', 'label', 'required' => false, 'attributes' => []]);
40 |
41 | Form::component('rRange', 'form::'.$style.'.regular.range', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
42 |
43 | Form::component('rSearch', 'form::'.$style.'.regular.search', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
44 |
45 | Form::component('rTel', 'form::'.$style.'.regular.tel', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
46 |
47 | Form::component('rNumber', 'form::'.$style.'.regular.number', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
48 |
49 | Form::component('rDate', 'form::'.$style.'.regular.date', ['name', 'label', 'default' => date('Y-m-d'), 'required' => false, 'attributes' => []]);
50 |
51 | Form::component('rUrl', 'form::'.$style.'.regular.url', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
52 |
53 | Form::component('rFile', 'form::'.$style.'.regular.file', ['name', 'label', 'required' => false, 'attributes' => []]);
54 |
55 | Form::component('rImage', 'form::'.$style.'.regular.image', ['name', 'label', 'required' => false, 'preview' => ['preview' => false, 'height' => 100, 'default' => '/img/logo-app.png'], 'attributes' => ['accept' => 'image/*']]);
56 |
57 | Form::component('rTextarea', 'form::'.$style.'.regular.textarea', ['name', 'label', 'default' => null, 'required' => false, 'attributes' => []]);
58 |
59 | Form::component('rSelect', 'form::'.$style.'.regular.select', ['name', 'label', 'data' => [], 'selected', 'required' => false, 'attributes' => []]);
60 |
61 | Form::component('rSelectMulti', 'form::'.$style.'.regular.selectmulti', ['name', 'label', 'data' => [], 'selected' => [], 'required' => false, 'attributes' => []]);
62 |
63 | Form::component('rSelectRange', 'form::'.$style.'.regular.selectrange', ['name', 'label', 'begin', 'end', 'selected', 'required' => false, 'attributes' => []]);
64 |
65 | Form::component('rSelectMonth', 'form::'.$style.'.regular.selectmonth', ['name', 'label', 'selected' => null, 'required' => false, 'attributes' => []]);
66 |
67 | Form::component('rSelectYear', 'form::'.$style.'.regular.selectyear', ['name', 'label', 'begin' => 1901, 'end' => date('Y'), 'selected' => null, 'required' => false, 'attributes' => []]);
68 |
69 | Form::component('rCheckbox', 'form::'.$style.'.regular.checkbox', ['name', 'label', 'values' => [], 'checked' => [], 'required' => false, 'attributes' => []]);
70 |
71 | Form::component('rRadio', 'form::'.$style.'.regular.radio', ['name', 'label', 'values' => [], 'checked' => null, 'required' => false, 'attributes' => []]);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Laraflow/Form
2 | [](//packagist.org/packages/laraflow/form)
3 | [](//packagist.org/packages/laraflow/form)
4 | [](//github.com/laraflow/form/actions/workflows/run-tests.yml)
5 | [](//packagist.org/packages/laraflow/form)
6 | [](//packagist.org/packages/laraflow/form)
7 | [](https://github.com/laraflow/form/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
8 |
9 |
10 | ## Introduction
11 | [``laraflow/form``](https://packagist.org/packages/laraflow/form) is a collection of Laravel form components.
12 |
13 | ## Roadmap
14 | | Feature | Status |
15 | |----------|-------|
16 | |Boostrap4 Regular| Complated|
17 | |Boostrap4 Horizontal| Complated|
18 | |Boostrap5 Regular| Complated|
19 | |Boostrap5 Horizontal| Complated|
20 | |TailwindCSS Regular| WIP|
21 | |TailwindCSS Horizontal| WIP|
22 | |Blade X Component| Todo |
23 |
24 |
25 | ## Features
26 | This package has basic form element style that is supported by bootstrap.
27 | Some basic form styles are given below:
28 | * Normal
29 | * Icon Input Grouped
30 | * Horizontal Columned
31 | * Inline Elements
32 |
33 | ## Installation
34 | To get start using this package follow these instructions.
35 | You can install the package via composer:
36 |
37 | ```bash
38 | composer require laraflow/form
39 | ```
40 |
41 | You need to publish the config file with:
42 |
43 | ```bash
44 | php artisan vendor:publish --tag="form-config"
45 | ```
46 |
47 | This is the contents of the published config file:
48 |
49 | ```php
50 | return [
51 | /**
52 | * Form style validation and other component will
53 | * be selected form this section
54 | * @var string style
55 | * @value bootstrap4, bootstrap5
56 | */
57 | 'style' => 'bootstrap4',
58 |
59 | /**
60 | * Form local language for field that support localization
61 | *
62 | * @reference month, day etc
63 | * @var string style
64 | * @value bootstrap3, bootstrap4, bootstrap5
65 | */
66 | 'locale' => 'en',
67 |
68 | /**
69 | * Form month values what value and label month dropdown
70 | * will have
71 | *
72 | * @var array month
73 | */
74 |
75 | 'months' => [
76 | "1" => "January",
77 | "2" => "February",
78 | "3" => "March",
79 | "4" => "April",
80 | "5" => "May",
81 | "6" => "June",
82 | "7" => "July",
83 | "8" => "August",
84 | "9" => "September",
85 | "10" => "October",
86 | "11" => "November",
87 | "12" => "December"
88 | ],
89 |
90 | /**
91 | * Form day values what value and label day dropdown
92 | * will have
93 | * @var array month
94 | */
95 |
96 | 'days' => [
97 | "1" => "Saturday",
98 | "2" => "Sunday",
99 | "3" => "Monday",
100 | "4" => "Tuesday",
101 | "5" => "Wednesday",
102 | "6" => "Thursday",
103 | "7" => "Friday"
104 | ],
105 | ];
106 | ```
107 |
108 | Optionally, you can publish the views using
109 |
110 | ```bash
111 | php artisan vendor:publish --tag="form-views"
112 | ```
113 |
114 | Done. Now you can fully utilize every form elements from these package
115 |
116 | ### Contributing
117 |
118 | Thank you for considering contributing to the Form!
119 | The contribution guide can be found in the [Form Wiki](https://github.com/laraflow/form/wiki/).
120 |
121 | ### Security Vulnerabilities
122 |
123 | If you discover a security vulnerability within Form Package,
124 | please send an e-mail to Mohammad Hafijul Islam via [laraflow@gmail.com](mailto:laraflow@gmail.com).
125 | All security vulnerabilities will be promptly addressed.
126 |
127 | ### License
128 |
129 | The Form is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
130 |
131 |
132 | ## Testing
133 |
134 | ```bash
135 | composer test
136 | ```
137 |
138 | ## Changelog
139 |
140 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
141 |
142 | ## Contributing
143 |
144 | Please see [CONTRIBUTING](https://github.com/laraflow/form/blob/main/docs/contributing.md) for details.
145 |
146 | ## Security Vulnerabilities
147 |
148 | Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
149 |
150 | ## Credits
151 |
152 | - [Hafijul Islam](https://github.com/hafijul233)
153 | - [All Contributors](../../contributors)
154 |
155 | Spacial Thanks to For Awesome IDE support.
156 |
157 | ## License
158 |
159 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
160 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-docs",
3 | "version": "0.1.0",
4 | "description": "docs",
5 | "main": "index.js",
6 | "dependencies": {
7 | "abbrev": "^1.1.1",
8 | "acorn": "^7.4.1",
9 | "acorn-node": "^1.8.2",
10 | "acorn-walk": "^7.2.0",
11 | "aigle": "^1.14.1",
12 | "aigle-core": "^1.0.0",
13 | "ajv": "^8.11.0",
14 | "ansi-regex": "^5.0.1",
15 | "ansi-styles": "^4.3.0",
16 | "anymatch": "^3.1.2",
17 | "arg": "^5.0.2",
18 | "balanced-match": "^1.0.2",
19 | "binary-extensions": "^2.2.0",
20 | "blade-formatter": "^1.27.4",
21 | "brace-expansion": "^2.0.1",
22 | "braces": "^3.0.2",
23 | "buffer-from": "^1.1.2",
24 | "camelcase-css": "^2.0.1",
25 | "chalk": "^4.1.2",
26 | "chokidar": "^3.5.3",
27 | "cliui": "^7.0.4",
28 | "color-convert": "^2.0.1",
29 | "color-name": "^1.1.4",
30 | "commander": "^2.20.3",
31 | "concat-stream": "^2.0.0",
32 | "config-chain": "^1.1.13",
33 | "core-js-pure": "^3.24.1",
34 | "cssesc": "^3.0.0",
35 | "defined": "^1.0.0",
36 | "detect-indent": "^6.1.0",
37 | "detective": "^5.2.1",
38 | "didyoumean": "^1.2.2",
39 | "dlv": "^1.1.3",
40 | "editorconfig": "^0.15.3",
41 | "emoji-regex": "^8.0.0",
42 | "escalade": "^3.1.1",
43 | "fast-deep-equal": "^3.1.3",
44 | "fast-glob": "^3.2.11",
45 | "fastq": "^1.13.0",
46 | "fill-range": "^7.0.1",
47 | "find-config": "^1.0.0",
48 | "fs.realpath": "^1.0.0",
49 | "function-bind": "^1.1.1",
50 | "get-caller-file": "^2.0.5",
51 | "glob": "^8.0.3",
52 | "glob-parent": "^6.0.2",
53 | "has": "^1.0.3",
54 | "has-flag": "^4.0.0",
55 | "html-attribute-sorter": "^0.4.2",
56 | "ignore": "^5.2.0",
57 | "inflight": "^1.0.6",
58 | "inherits": "^2.0.4",
59 | "ini": "^1.3.8",
60 | "is-binary-path": "^2.1.0",
61 | "is-core-module": "^2.10.0",
62 | "is-extglob": "^2.1.1",
63 | "is-fullwidth-code-point": "^3.0.0",
64 | "is-glob": "^4.0.3",
65 | "is-number": "^7.0.0",
66 | "js-beautify": "^1.14.5",
67 | "json-schema-traverse": "^1.0.0",
68 | "lilconfig": "^2.0.6",
69 | "linguist-languages": "^7.21.0",
70 | "lodash": "^4.17.21",
71 | "lru-cache": "^4.1.5",
72 | "map-age-cleaner": "^0.1.3",
73 | "mem": "^8.1.1",
74 | "merge2": "^1.4.1",
75 | "micromatch": "^4.0.5",
76 | "mimic-fn": "^3.1.0",
77 | "minimatch": "^5.1.0",
78 | "minimist": "^1.2.6",
79 | "nanoid": "^3.3.4",
80 | "nopt": "^6.0.0",
81 | "normalize-path": "^3.0.0",
82 | "object-hash": "^3.0.0",
83 | "once": "^1.4.0",
84 | "os-homedir": "^1.0.2",
85 | "p-defer": "^1.0.0",
86 | "path-parse": "^1.0.7",
87 | "php-parser": "^3.1.0",
88 | "picocolors": "^1.0.0",
89 | "picomatch": "^2.3.1",
90 | "pify": "^2.3.0",
91 | "postcss": "^8.4.16",
92 | "postcss-import": "^14.1.0",
93 | "postcss-js": "^4.0.0",
94 | "postcss-load-config": "^3.1.4",
95 | "postcss-nested": "^5.0.6",
96 | "postcss-selector-parser": "^6.0.10",
97 | "postcss-value-parser": "^4.2.0",
98 | "prettier": "^2.7.1",
99 | "proto-list": "^1.2.4",
100 | "pseudomap": "^1.0.2",
101 | "punycode": "^2.1.1",
102 | "queue-microtask": "^1.2.3",
103 | "quick-lru": "^5.1.1",
104 | "read-cache": "^1.0.0",
105 | "readable-stream": "^3.6.0",
106 | "readdirp": "^3.6.0",
107 | "regenerator-runtime": "^0.13.9",
108 | "require-directory": "^2.1.1",
109 | "require-from-string": "^2.0.2",
110 | "resolve": "^1.22.1",
111 | "reusify": "^1.0.4",
112 | "run-parallel": "^1.2.0",
113 | "safe-buffer": "^5.2.1",
114 | "semver": "^5.7.1",
115 | "sigmund": "^1.0.1",
116 | "source-map-js": "^1.0.2",
117 | "string_decoder": "^1.3.0",
118 | "string-width": "^4.2.3",
119 | "strip-ansi": "^6.0.1",
120 | "supports-color": "^7.2.0",
121 | "supports-preserve-symlinks-flag": "^1.0.0",
122 | "tailwindcss": "^3.1.8",
123 | "to-regex-range": "^5.0.1",
124 | "typedarray": "^0.0.6",
125 | "uri-js": "^4.4.1",
126 | "user-home": "^2.0.0",
127 | "util-deprecate": "^1.0.2",
128 | "vscode-oniguruma": "^1.6.2",
129 | "vscode-textmate": "^7.0.1",
130 | "wrap-ansi": "^7.0.0",
131 | "wrappy": "^1.0.2",
132 | "xregexp": "^5.1.1",
133 | "xtend": "^4.0.2",
134 | "y18n": "^5.0.8",
135 | "yallist": "^2.1.2",
136 | "yaml": "^1.10.2",
137 | "yargs": "^17.5.1",
138 | "yargs-parser": "^21.1.1"
139 | },
140 | "devDependencies": {
141 | "blade-formatter": "^1.27.4"
142 | },
143 | "scripts": {
144 | "test": "echo \"Error: no test specified\" && exit 1"
145 | },
146 | "repository": {
147 | "type": "git",
148 | "url": "git+https://github.com/laraflow/form.git"
149 | },
150 | "keywords": [
151 | "laravel",
152 | "form",
153 | "bootstrap"
154 | ],
155 | "author": "Mohammad Hafijul Islam ",
156 | "license": "MIT",
157 | "bugs": {
158 | "url": "https://github.com/laraflow/form/issues"
159 | },
160 | "homepage": "https://github.com/laraflow/form#readme"
161 | }
162 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | Github Discussions.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/src/Facades/Form.php:
--------------------------------------------------------------------------------
1 | 2])
59 | * @method static HtmlString fLabel(string $name, string $title, bool $required = false, array $options = ['col_size' => 2])
60 | *
61 | * @see \Laraflow\Form\Providers\HorizontalFieldServiceProvider
62 | *
63 | * @method static HtmlString hText(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
64 | * @method static HtmlString hEmail(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
65 | * @method static HtmlString hPassword(string $name, string $label, bool $required = false, int $col_size = 2, array $attributes = [])
66 | * @method static HtmlString hRange(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
67 | * @method static HtmlString hSearch(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
68 | * @method static HtmlString hTel(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
69 | * @method static HtmlString hNumber(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
70 | * @method static HtmlString hDate(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
71 | * @method static HtmlString hUrl(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
72 | * @method static HtmlString hFile(string $name, string $label, bool $required = false, int $col_size = 2, array $attributes = [])
73 | * @method static HtmlString hTextarea(string $name, string $label, mixed $default = null, bool $required = false, int $col_size = 2, array $attributes = [])
74 | * @method static HtmlString hSelect(string $name, string $label, mixed $data = [], mixed $selected = null, bool $required = false, int $col_size = 2, array $attributes = [])
75 | * @method static HtmlString hSelectMulti(string $name, string $label, mixed $data = [], mixed $selected = [], bool $required = false, int $col_size = 2, array $attributes = [])
76 | * @method static HtmlString hSelectRange(string $name, string $label, mixed $begin = 0, mixed $end = 100, $selected = null, bool $required = false, int $col_size = 2, array $attributes = [])
77 | * @method static HtmlString hSelectDay(string $name, string $label, mixed $selected = null, $selected = null, bool $required = false, int $col_size = 2, array $attributes = [])
78 | * @method static HtmlString hSelectMonth(string $name, string $label, mixed $selected = null, bool $required = false, int $col_size = 2, array $attributes = [])
79 | * @method static HtmlString hCheckbox(string $name, string $label, mixed $values = [], mixed $checked = [], bool $required = false, int $col_size = 2, array $attributes = [])
80 | * @method static HtmlString hRadio(string $name, string $label, mixed $values = [], mixed $checked = null, bool $required = false, int $col_size = 2, array $attributes = [])
81 | *
82 | * @see \Laraflow\Form\Providers\RegularFieldServiceProvider
83 | *
84 | * @method static HtmlString rText(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
85 | * @method static HtmlString rEmail(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
86 | * @method static HtmlString rPassword(string $name, string $label, bool $required = false, array $attributes = [])
87 | * @method static HtmlString rRange(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
88 | * @method static HtmlString rSearch(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
89 | * @method static HtmlString rTel(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
90 | * @method static HtmlString rNumber(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
91 | * @method static HtmlString rDate(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
92 | * @method static HtmlString rUrl(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
93 | * @method static HtmlString rFile(string $name, string $label, bool $required = false, array $attributes = [])
94 | * @method static HtmlString rImage(string $name, string $label, bool $required = false, array $attributes = [])
95 | * @method static HtmlString rTextarea(string $name, string $label, mixed $default = null, bool $required = false, array $attributes = [])
96 | * @method static HtmlString rSelect(string $name, string $label, mixed $data = [], mixed $selected = null, bool $required = false, array $attributes = [])
97 | * @method static HtmlString rSelectMulti(string $name, string $label, mixed $data = [], mixed $selected = [], bool $required = false, array $attributes = [])
98 | * @method static HtmlString rSelectRange(string $name, string $label, mixed $begin = 0, mixed $end = 100, $selected = null, bool $required = false, array $attributes = [])
99 | * @method static HtmlString rSelectDay(string $name, string $label, mixed $selected = null, $selected = null, bool $required = false, array $attributes = [])
100 | * @method static HtmlString rSelectMonth(string $name, string $label, mixed $selected = null, bool $required = false, array $attributes = [])
101 | * @method static HtmlString rSelectYear(string $name, string $label, mixed $begin = 0, mixed $end = 100, $selected = null, bool $required = false, array $attributes = [])
102 | * @method static HtmlString rCheckbox(string $name, string $label, mixed $values = [], mixed $checked = [], bool $required = false, array $attributes = [])
103 | * @method static HtmlString rRadio(string $name, string $label, mixed $values = [], mixed $checked = null, bool $required = false, array $attributes = [])
104 | **/
105 | class Form extends Facade
106 | {
107 | /**
108 | * Get the registered name of the component.
109 | */
110 | protected static function getFacadeAccessor(): string
111 | {
112 | return 'form';
113 | }
114 | }
115 |
--------------------------------------------------------------------------------