relasi wilayah ekosistem

This commit is contained in:
2026-06-08 13:25:33 +07:00
parent f11be9d288
commit 482c3fc474
11 changed files with 470 additions and 70 deletions
+9
View File
@@ -242,6 +242,7 @@ class FormBasisData extends Model
} else {
$html .= '<select class="form-select tipe-foreign_key kolom_error" id="value-data-kolom_name" name="kolom_name">';
if ($optionsFK && $optionsFK->where('kolom_id', $k->id)->first() != null) {
// dd($optionsFK->where('kolom_id', $k->id)->first());
foreach ($optionsFK->where('kolom_id', $k->id)->first()['options'] as $option) {
$html .= '<option value="'.$option->value.'" '.(old($k->kolom) == $option->value ? 'selected' : '').'>'.$option->label.'</option>';
}
@@ -376,6 +377,14 @@ class FormBasisData extends Model
->replace('kolom_value', e($value ? $value['value_'.$k->tipe] : null));
}
}
if ($errors && $errors->has($k->kolom)) {
if ($framework == 'tailwind') {
$html .= '<p className="mt-2 text-sm text-red-600">'.$errors->first($k->kolom).'</p>';
} else {
$html .= '<div class="invalid-feedback">'.$errors->first($k->kolom).'</div>';
}
}
}
return $html;