ldc-portsalaries/resources/views/crud/formfields/string.blade.php
Jérémy Munsch ed81e31e09 - Fix sites select on users
- add users policy
- correct readonly handle on crud
- crud readonly callback support
- crud readonly for belongsTo and belongsToMany
2021-06-07 18:29:02 +02:00

33 lines
1.4 KiB
PHP

<td>
<label for="{{ $fieldName }}" class="form-label">{{ $prop['label'] }}</label>
</td>
<td>
@if(strlen($prop['placeholder']))
<div class="form-floating">
<input
id="{{ $fieldName }}"
name="{{ $fieldName }}"
type="text"
class="form-control"
value="{{ old($fieldName) ?? $model->{$fieldName} ?? '' }}"
@if(isset($prop['rules']['max']))maxlength="{{ $prop['rules']['max'] }}"@endif
@if(isset($prop['rules']['min']))minlength="{{ $prop['rules']['min'] }}"@endif
@if($prop['disabled'])disabled @endif
@if($readonly)readonly @endif
@if($prop['required'] or (!$prop['required'] and !$prop['nullable']))required @endif>
<label for="{{ $fieldName }}" class="form-label">{{ __('ex: :placeholder', ['placeholder' => $prop['placeholder']]) }}</label>
</div>
@else
<input
id="{{ $fieldName }}"
name="{{ $fieldName }}"
type="text"
class="form-control"
value="{{ old($fieldName) ?? $model->{$fieldName} ?? '' }}"
@if(isset($prop['rules']['max']))maxlength="{{ $prop['rules']['max'] }}"@endif
@if(isset($prop['rules']['min']))minlength="{{ $prop['rules']['min'] }}"@endif
@if($prop['disabled'])disabled @endif
@if($readonly)readonly @endif
@if($prop['required'] or (!$prop['required'] and !$prop['nullable']))required @endif>
@endif
</td>