Skip to content

Commit

Permalink
Merge pull request #9 from hafijul233/develop
Browse files Browse the repository at this point in the history
support form inline icon added
  • Loading branch information
hafijul233 authored Nov 20, 2021
2 parents f962f60 + 1cf8af9 commit 6a81d91
Show file tree
Hide file tree
Showing 22 changed files with 415 additions and 115 deletions.
6 changes: 3 additions & 3 deletions resources/views/bootstrap4/inline/checkbox.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
$options = ['class' => 'custom-control-input ' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp

@foreach($values as $value => $display)

@php $id = $name . '-checkbox-' . $value; $options['id'] = $id; @endphp
@php $id = $name . '-checkbox-' . $value; $options['id'] = $id @endphp

<div class="custom-control custom-checkbox custom-control-inline">
{!! \Form::checkbox($name . '[]', $value, in_array($value, $checked), array_merge($options, $attributes)) !!}
{!! Form::checkbox($name . '[]', $value, in_array($value, $checked), array_merge($options, $attributes)) !!}

{!! Form::nLabel($id, $display,false, ['class' => 'custom-control-label']) !!}
</div>
Expand Down
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/date.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::date($name, $default, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::date($name, $default, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
26 changes: 24 additions & 2 deletions resources/views/bootstrap4/inline/email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,31 @@
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp
{!! Form::email($name, $default, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::email($name, $default, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
2 changes: 1 addition & 1 deletion resources/views/bootstrap4/inline/file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp
<div class="custom-file">
{!! Form::nLabel('','Choose file...', false, ['class' => 'custom-file-label', 'id' => $name .'_file_label']) !!}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap4/inline/image.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp
<div class="custom-file">
{!! Form::nLabel('','Choose file...', false, ['class' => 'custom-file-label', 'id' => $name .'_file_label']) !!}
Expand Down
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/number.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::number($name, $default, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::number($name, $default, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>
{!! Form::nError($name, $msg) !!}
</div>
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::password($name, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::passwprd($name, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
6 changes: 3 additions & 3 deletions resources/views/bootstrap4/inline/radio.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
$options = ['class' => 'custom-control-input ' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp

@foreach($values as $value => $display)

@php $id = $name . '-radio-' . $value; $options['id'] = $id; @endphp
@php $id = $name . '-radio-' . $value; $options['id'] = $id @endphp

<div class="custom-control custom-radio custom-control-inline">
{!! \Form::radio($name, $value, ($value == $checked), array_merge($options, $attributes)) !!}
{!! Form::radio($name, $value, ($value == $checked), array_merge($options, $attributes)) !!}

{!! Form::nLabel($id, $display,false, ['class' => 'custom-control-label']) !!}
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap4/inline/range.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
$options['required'] = 'required'
@endphp

{!! Form::range($name, $default, array_merge($options, $attributes)) !!}
Expand Down
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::search($name, $default, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::search($name, $default, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::select($name, $data, $selected, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::select($name, $data, $selected, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/selectmonth.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name, $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL )];
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL )];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::selectMonth($name, $selected, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::select($name, config('form.months'), $selected, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name, $msg) !!}
</div>
32 changes: 27 additions & 5 deletions resources/views/bootstrap4/inline/selectmulti.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,37 @@
{!! Form::nLabel($name . '[]', $label, $required, ['class' => 'sr-only d-none']) !!}

@php
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL ), "multiple" => "multiple"];
$options = ['class' => 'form-control custom-select' . ($errors->has($name) ? ' is-invalid' : NULL ), "multiple" => "multiple"];
$msg = $errors->first($name) ?? null;
$msg = $errors->first($name) ?? null;
if(isset($required) && $required == true)
$options['required'] = 'required';
if(isset($required) && $required == true)
$options['required'] = 'required'
@endphp

{!! Form::select($name . '[]', $data, $selected, array_merge($options, $attributes)) !!}
<div class="input-group">
@if(isset($position) && $position == 'before')
<div class="input-group-prepend">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif

{!! Form::select($name . '[]', $data, $selected, array_merge($options, $attributes)) !!}

@if(isset($position) && $position == 'after')
<div class="input-group-append">
<div class="input-group-text">
@if(!empty($icon))
<span class="{{ $icon }}"></span>
@endif
</div>
</div>
@endif
</div>

{!! Form::nError($name . '[]', $msg) !!}
</div>
Loading

0 comments on commit 6a81d91

Please sign in to comment.