@php $related = isset($model) ? $model->{$fieldName}->mapWithKeys(function ($model) use($prop) { return [$model->{'id'} => [ 'label' => $model->{$prop['belongsToManyLabel']}, 'value' => $model->{'id'} ]]; }) : []; @endphp @push('scriptsConstants') @endpush