@php $options = is_object($options) && method_exists($options, 'map') ? $options->map(function($label, $value) { return [ 'value' => $value, 'label' => $label ]; })->values()->toArray() : $options; $note = $note ?? false; $inline = $inline ?? false; $border = $border ?? false; $columns = $columns ?? 0; // do not use for now, but this will allow you to create a new option directly from the form $addNew = $addNew ?? false; $moduleName = $moduleName ?? null; $storeUrl = $storeUrl ?? ''; $inModal = $fieldsInModal ?? false; @endphp @if($addNew)
@partialView(($moduleName ?? null), 'create', ['renderForModal' => true, 'fieldsInModal' => true])
@endif
@unless($renderForBlocks || $renderForModal || (!isset($item->$name) && null == $formFieldsValue = getFormFieldsValue($form_fields, $name))) @push('vuexStore') window['{{ config('twill.js_namespace') }}'].STORE.form.fields.push({ name: '{{ $name }}', value: {!! json_encode(isset($item) && isset($item->$name) ? (is_string($item->$name) ? json_decode($item->$name) : Arr::pluck($item->$name, 'id')) : $formFieldsValue) !!} }) @endpush @endunless