hm ok this kind of works

This commit is contained in:
spencerrlongg 2024-09-25 13:00:35 -05:00
parent 21906d8c27
commit f3ad89931f
2 changed files with 5 additions and 4 deletions

View file

@ -161,7 +161,7 @@ class AssetModelsController extends Controller
if ($this->shouldAddDefaultValues($request->input())) {
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))) {
//return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
return redirect()->back()->withErrors($this->validatorErrors);
return redirect()->back()->withInput()->withErrors($this->validatorErrors);
}
}
@ -487,7 +487,8 @@ class AssetModelsController extends Controller
$validator = Validator::make($data, $rules);
if($validator->fails()){
$this->validatorErrors = $validator->messages();
$this->validatorErrors = $validator->errors();
dump($this->validatorErrors);
return false;
}

View file

@ -1,4 +1,5 @@
<span>
@dump($errors)
<div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<label for="custom_fieldset" class="col-md-3 control-label">
{{ trans('admin/models/general.fieldset') }}
@ -17,11 +18,10 @@
</div>
</div>
@if ($add_default_values)
@if ($add_default_values || $errors->count() > 0)
@if ($this->fields)
@foreach ($this->fields as $field)
@dump($errors)
@if($errors->has($field->db_column_name()))
"poop"
@endif