Extended FormFields hook interface to Voyager BREAD
This interface extends VoyagerBaseController::getContentBasedOnType()
, which makes it easy to add data handlers for your own FormFields.
The package includes several additional FormFields:
- Key-Value to JSON
- Multiple Images with tag attributes
Over time, this list will be updated with new items.
Required
"laravel/framework": "5.7.*"
"tcg/voyager": "^1.1"
Key-Value to JSON
In BREAD configuration:
Add new item / Edit item:
Final Data:
Multiple Images with tag attributes
In BREAD configuration
Add new item / Edit item:
Final Data:
MODAL Template Custom
Include in template only:
// Add area image
@foreach($dataType->addRows as $row)
@if ($row->type === 'multiple_images_with_attrs')
<div class="form-group">
<label for="name">{{ $row->display_name }}</label>
{!! Voyager::formField($row, $dataType, $dataTypeContent) !!}
</div>
@break
@endif
@endforeach
<div class="modal fade modal-danger" id="confirm_delete_modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title"><i class="voyager-warning"></i> {{ __('voyager::generic.are_you_sure') }}</h4>
</div>
<div class="modal-body">
<h4>{{ __('voyager::generic.are_you_sure_delete') }} '<span class="confirm_delete_name"></span>'</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('voyager::generic.cancel') }}</button>
<button type="button" class="btn btn-danger" id="confirm_delete">{{ __('voyager::generic.delete_confirm') }}</button>
</div>
</div>
</div>
</div>