@php if ( Ui::keyset($attributes, 'layout') == null || (Ui::keyset($attributes, 'layout') != null && $attributes['layout'] == 'h') ) { $horizental = true; $row = ' row'; $labelClass = 'col-2 col-form-label'; } else { $horizental = false; $row = ''; $labelClass = 'col-form-label'; } $dec = json_decode($value, true); if (is_array($dec)) { $value = $dec; } if (is_string($value)) { $value = explode(',', $value); } if (isset($attributes['enable_insert']) && $attributes['enable_insert']) { $enable_insert = $attributes['enable_insert']; } else { $enable_insert = false; } if (isset($attributes['modelName'])) { if ( auth() ->user() ->can('insert_' . strtolower($attributes['modelName'])) ) { if ($enable_insert) { $parentModelName = $attributes['modelName']; $x = '\\App\\Models\\' . $parentModelName; $parentModel = new $x(); $parentFields = \App\Helpers\Form::getModalFormFields($parentModel); } } } if (isset($attributes['required']) && $attributes['required'] === true) { $labelClass .= ' required'; } @endphp