@php $options = is_object($options) && method_exists($options, 'map') ? $options->map(function($label, $value) { return [ 'value' => $value, 'label' => $label ]; })->values()->toArray() : $options; $unpack = $unpack ?? true; $note = $note ?? 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 ($unpack) @if($addNew) @partialView(($moduleName ?? null), 'create', ['renderForModal' => true, 'fieldsInModal' => true]) @endif @else @if($addNew) @partialView(($moduleName ?? null), 'create', ['renderForModal' => true, 'fieldsInModal' => true]) @endif @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) ? Arr::pluck($item->$name, 'id') : $formFieldsValue) !!} }) @endpush @endunless