From f3ad89931f1bf21e4306876d0a686b85764c3fe5 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 25 Sep 2024 13:00:35 -0500 Subject: [PATCH] hm ok this kind of works --- app/Http/Controllers/AssetModelsController.php | 5 +++-- .../custom-field-set-default-values-for-model.blade.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 7bf1b503ac..f7fd040452 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -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; } diff --git a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php index 2f6468fafd..f6351fa010 100644 --- a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php +++ b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php @@ -1,4 +1,5 @@ + @dump($errors)
- @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