From 9779d2e57803414392c0b3c52470688940b3fe59 Mon Sep 17 00:00:00 2001 From: anazaryan Date: Mon, 25 Nov 2024 19:28:33 +0400 Subject: [PATCH] allow set counters description empty --- app/Http/Controllers/Admin/CompanyController.php | 4 +++- resources/views/admin/counters_main/form.blade.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/CompanyController.php b/app/Http/Controllers/Admin/CompanyController.php index 65cf509..39d8e95 100644 --- a/app/Http/Controllers/Admin/CompanyController.php +++ b/app/Http/Controllers/Admin/CompanyController.php @@ -57,9 +57,11 @@ class CompanyController extends Controller } public function counters_main_update(Request $request, string $name) { + $data = $request->all(); + $data['description'] = $data['description'] ?? ''; PageContent::updateOrCreate( ['name' => $name], - array_merge(['name' => $name], $request->all()) + array_merge(['name' => $name], $data) ); $block_names = MainPageCounters::values();; $blocks = PageContent::select('name', 'title', 'description', 'extra') diff --git a/resources/views/admin/counters_main/form.blade.php b/resources/views/admin/counters_main/form.blade.php index a2037a1..ff9b900 100644 --- a/resources/views/admin/counters_main/form.blade.php +++ b/resources/views/admin/counters_main/form.blade.php @@ -27,7 +27,7 @@