[WIP] Refactor project
This commit is contained in:
51
resources/views/vendor/boilerplate/components/input.blade.php
vendored
Normal file
51
resources/views/vendor/boilerplate/components/input.blade.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
@if(empty($name))
|
||||
<code>
|
||||
<x-boilerplate::input>
|
||||
The name attribute has not been set
|
||||
</code>
|
||||
@else
|
||||
<div class="form-group">
|
||||
@isset($label)
|
||||
{{ Form::label($name, __($label)) }}
|
||||
@endisset
|
||||
@if($prepend || $prependText || $append || $appendText)
|
||||
<div class="input-group">
|
||||
@endif
|
||||
@if($prepend || $prependText)
|
||||
<div class="input-group-prepend">
|
||||
@if($prepend)
|
||||
{!! $prepend !!}
|
||||
@else
|
||||
<span class="input-group-text">{!! $prependText !!}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@if($type === 'password')
|
||||
{{ Form::password($name, array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) }}
|
||||
@elseif($type === 'file')
|
||||
{{ Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) }}
|
||||
@elseif($type === 'select')
|
||||
{{ Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) }}
|
||||
@else
|
||||
{{ Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) }}
|
||||
@endif
|
||||
@if($append || $appendText)
|
||||
<div class="input-group-append">
|
||||
@if($append)
|
||||
{!! $append !!}
|
||||
@else
|
||||
<span class="input-group-text">{!! $appendText !!}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@if($prepend || $prependText || $append || $appendText)
|
||||
</div>
|
||||
@endif
|
||||
@if($help ?? false)
|
||||
<small class="form-text text-muted">@lang($help)</small>
|
||||
@endif
|
||||
@error($name)
|
||||
<div class="error-bubble"><div>{{ $message }}</div></div>
|
||||
@enderror
|
||||
</div>
|
||||
@endif
|
||||
Reference in New Issue
Block a user