relasi wilayah ekosistem
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user