ldc-supportweb/resources/views/crud/formfields/enum.blade.php
Jérémy Munsch b60913525b - bump to Bootstrap 5
- added ACL policies
- added CRUD generic
- added User crud
- added search bar
2021-06-18 15:39:19 +02:00

13 lines
600 B
PHP

<td>
<label for="{{ $fieldName }}" class="form-label">{{ $prop['label'] }}</label>
</td>
<td>
<select id="{{ $fieldName }}" class="form-control" name="{{ $fieldName }}" @if($prop['readonly']) readonly @endif @if($prop['disabled']) disabled @endif>
{{-- TODO handle enum nullable ? --}}
{{-- @if($prop['nullable'])
@endif --}}
@foreach ($prop['enum']::toArray() as $enum)
<option value="{{$enum->value}}" @if(isset($model) and $enum->equals($model->{$fieldName}))selected @endif>{{__($enum->label)}}</option>
@endforeach
</select>
</td>